linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: David Hildenbrand <david@redhat.com>
Cc: Zi Yan <ziy@nvidia.com>,
	nifan.cxl@gmail.com, mcgrof@kernel.org, a.manzanares@samsung.com,
	dave@stgolabs.net, akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, will@kernel.org,
	aneesh.kumar@kernel.org, hca@linux.ibm.com, gor@linux.ibm.com,
	linux-s390@vger.kernel.org, Fan Ni <fan.ni@samsung.com>
Subject: Re: [PATCH] mm: Introduce free_folio_and_swap_cache() to replace free_page_and_swap_cache()
Date: Thu, 10 Apr 2025 19:51:53 +0100	[thread overview]
Message-ID: <Z_gTSSJ8RnRrvFz4@casper.infradead.org> (raw)
In-Reply-To: <83e8b1b3-fc73-4a49-9f6c-36489c3f39d6@redhat.com>

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.


  reply	other threads:[~2025-04-10 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 18:00 nifan.cxl
2025-04-10 18:11 ` Matthew Wilcox
2025-04-10 18:16 ` Zi Yan
2025-04-10 18:25   ` Matthew Wilcox
2025-04-10 18:36     ` David Hildenbrand
2025-04-10 18:51       ` Matthew Wilcox [this message]
2025-04-10 18:55     ` Zi Yan
2025-04-10 20:31 ` Davidlohr Bueso
2025-04-11 19:15 ` Vishal Moola (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_gTSSJ8RnRrvFz4@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=a.manzanares@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=fan.ni@samsung.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=nifan.cxl@gmail.com \
    --cc=will@kernel.org \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox