linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Yu Zhao <yuzhao@google.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Yin Fengwei <fengwei.yin@intel.com>,
	David Hildenbrand <david@redhat.com>,
	Yang Shi <shy828301@gmail.com>,
	"Huang, Ying" <ying.huang@intel.com>, Zi Yan <ziy@nvidia.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v3 2/3] mm: Implement folio_remove_rmap_range()
Date: Wed, 26 Jul 2023 17:44:50 +0100	[thread overview]
Message-ID: <ZMFNgmlT1JpI0z5+@casper.infradead.org> (raw)
In-Reply-To: <CAOUHufamqn0b8tN1DppfPi7FRnENzYwcSOVcAKNxkj=CYa+OwQ@mail.gmail.com>

On Tue, Jul 25, 2023 at 11:53:26PM -0600, Yu Zhao wrote:
> > +void folio_remove_rmap_range(struct folio *folio, struct page *page,
> > +               int nr, struct vm_area_struct *vma);
> 
> I prefer folio_remove_rmap_range(page, nr, vma). Passing both the
> folio and the starting page seems redundant to me.
> 
> Matthew, is there a convention (function names, parameters, etc.) for
> operations on a range of pages within a folio?

We've been establishing that convention recently, yes.  It seems
pointless to re-derive the folio from the page when the caller already
has the folio.  I also like Ryan's point that it reinforces that all
pages must be from the same folio.

> And regarding the refactor, what I have in mind is that
> folio_remove_rmap_range() is the core API and page_remove_rmap() is
> just a wrapper around it, i.e., folio_remove_rmap_range(page, 1, vma).
> 
> Let me post a diff later and see if it makes sense to you.

I think that can make sense.  Because we limit to a single page table,
specifying 'nr = 1 << PMD_ORDER' is the same as 'compound = true'.
Just make it folio, page, nr, vma.  I'd actually prefer it as (vma,
folio, page, nr), but that isn't the convention we've had in rmap up
until now.


  parent reply	other threads:[~2023-07-26 16:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 11:29 [PATCH v3 0/3] Optimize large folio interaction with deferred split Ryan Roberts
2023-07-20 11:29 ` [PATCH v3 1/3] mm: Allow deferred splitting of arbitrary large anon folios Ryan Roberts
2023-07-20 11:29 ` [PATCH v3 2/3] mm: Implement folio_remove_rmap_range() Ryan Roberts
2023-07-26  5:53   ` Yu Zhao
2023-07-26  6:42     ` Ryan Roberts
2023-07-26 16:44     ` Matthew Wilcox [this message]
2023-07-27  1:29       ` Huang, Ying
2023-07-27  2:35         ` Matthew Wilcox
2023-07-27  7:26           ` Ryan Roberts
2023-07-27 16:38             ` Yu Zhao
2023-07-28  9:00               ` Ryan Roberts
2023-08-01  7:40                 ` Yu Zhao
2023-07-20 11:29 ` [PATCH v3 3/3] mm: Batch-zap large anonymous folio PTE mappings Ryan Roberts
2023-07-26 16:19   ` Nathan Chancellor
2023-07-26 16:32     ` Ryan Roberts
2023-07-26 16:35       ` Nathan Chancellor
2023-07-26 19:38     ` Ryan Roberts
2023-07-26 19:50       ` Nathan Chancellor
2023-07-26 21:17         ` Ryan Roberts
2023-07-26 21:23           ` Nathan Chancellor
2023-07-26 21:28             ` Ryan Roberts

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=ZMFNgmlT1JpI0z5+@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=fengwei.yin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=ying.huang@intel.com \
    --cc=yuzhao@google.com \
    --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