[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_gTSSJ8RnRrvFz4@casper.infradead.org>
Date: Thu, 10 Apr 2025 19:51:53 +0100
From: Matthew Wilcox <willy@...radead.org>
To: David Hildenbrand <david@...hat.com>
Cc: Zi Yan <ziy@...dia.com>, nifan.cxl@...il.com, mcgrof@...nel.org,
a.manzanares@...sung.com, dave@...olabs.net,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, will@...nel.org,
aneesh.kumar@...nel.org, hca@...ux.ibm.com, gor@...ux.ibm.com,
linux-s390@...r.kernel.org, Fan Ni <fan.ni@...sung.com>
Subject: Re: [PATCH] mm: Introduce free_folio_and_swap_cache() to replace
free_page_and_swap_cache()
On Thu, Apr 10, 2025 at 08:36:34PM +0200, David Hildenbrand wrote:
> > but would we be better off just passing in the folio which contains the
> > page and always flush all pages in the folio?
>
> The delay_rmap needs the precise pages, so we cannot easily switch to folio
> + nr_refs.
>
> Once the per-page mapcounts are gone for good, we might no longer need
> page+nr_pages but folio+nr_refs would work.
Ah, I see. And we'll always need to support 'nr_pages' because we might
have COWed a page in the middle of a large folio and so there's no rule
we can possibly invent that allows us to infer how many pages of the
folio are mapped. We'd have to go and actually walk the page table
in the rmap code, and that sounds like a terrible idea.
Powered by blists - more mailing lists