mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
	 linux-kernel@vger.kernel.org, Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	 John Hubbard <jhubbard@nvidia.com>, Peter Xu <peterx@redhat.com>,
	Suren Baghdasaryan <surenb@google.com>,
	 Yuan-Hao Hsu <aa9736195201@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 8/8] mm/gup: batch contiguous same-folio PTEs into one refcount grab
Date: Tue, 03 Nov 2026 11:42:03 -0500	[thread overview]
Message-ID: <9d1572bd5e868d3c9d953aa5fae81967cc81ba55.camel@surriel.com> (raw)
In-Reply-To: <fa017227-448b-468f-9797-33c02854f018@kernel.org>

On Tue, 2026-11-03 at 09:35 +0100, David Hildenbrand (Arm) wrote:
> On 11/2/26 20:30, Rik van Riel wrote:
> > 
> > +/*
> > + * Return how many PTEs map consecutive pages of the same folio
> > and can be
> > + * committed as one run. Always at least 1.
> > + *
> > + * The write-fault and unshare checks in gup_lookup_pte() are per
> > PTE, but a
> > + * writable run needs no repeat: a writable anon page is
> > exclusive. A read-only
> > + * run under FOLL_WRITE or FOLL_PIN does need the per-page check,
> > so it stays
> > + * one page at a time.
> 
> That's a clear indication that this needs more work.
> 
> I'll try to get to it soon and see how it could be done in a cleaner
> way, likely
> it should be based on top of the gup-fast series where we will have
> helpers to
> check for required unsharing of multiple PTEs.

I'm all for sharing the same helpers.

How would you like to sequence things?

Do you prefer to merge both series separately,
and then get a follow-up series that merges
the helper functions?

Would you like Yeoreum Yun and me to combine
the series, merge the helper functions beforehand,
and then send you one larger, combined series?

I have spent enough time in gup.c that I would
be happy to get rid of some more of that code.

-- 
All Rights Reversed.

  reply	other threads:[~2026-11-03 16:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 19:30 [RFC PATCH v5 0/8] batch lookups in follow_page_mask() Rik van Riel
2026-11-02 19:30 ` [PATCH 1/8] mm/gup: break out gup_fill_pages() helper Rik van Riel
2026-11-03  8:43   ` David Hildenbrand (Arm)
2026-11-03 16:29     ` Rik van Riel
2026-11-03 16:39       ` David Hildenbrand (Arm)
2026-11-03 17:00         ` Rik van Riel
2026-11-03 17:04           ` David Hildenbrand (Arm)
2026-11-03 19:30             ` Rik van Riel
2026-11-02 19:30 ` [PATCH 2/8] mm/gup: convert follow_page_mask() to return a long Rik van Riel
2026-11-02 19:30 ` [PATCH 3/8] mm/gup: split out folio grab-and-store helper Rik van Riel
2026-11-02 19:30 ` [PATCH 4/8] mm/gup: break out gup_lookup_pte() helper Rik van Riel
2026-11-02 19:30 ` [PATCH 5/8] mm/gup: fill the pages array outside the pud/pmd lock Rik van Riel
2026-11-02 19:30 ` [PATCH 6/8] mm/gup: return a huge page's full count from follow_page_mask() Rik van Riel
2026-11-02 19:30 ` [PATCH 7/8] mm/gup: walk multiple PTEs per follow_page_pte() call Rik van Riel
2026-11-02 19:30 ` [PATCH 8/8] mm/gup: batch contiguous same-folio PTEs into one refcount grab Rik van Riel
2026-11-03  8:35   ` David Hildenbrand (Arm)
2026-11-03 16:42     ` Rik van Riel [this message]
2026-11-03 16:55       ` David Hildenbrand (Arm)

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=9d1572bd5e868d3c9d953aa5fae81967cc81ba55.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=aa9736195201@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=hch@infradead.org \
    --cc=jgg@ziepe.ca \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=surenb@google.com \
    --cc=yeoreum.yun@arm.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

all inboxes | Powered by JetHome®