Re: [PATCH v3 5/6] mm: gup: introduce gup_unshared_pages()
From: Yeoreum Yun
Date: Tue Nov 10 2026 - 17:22:07 EST
On Tue, Nov 10, 2026 at 02:21:18PM -0500, Rik van Riel wrote:
> On Tue, 2026-11-10 at 14:04 +0100, David Hildenbrand (Arm) wrote:
> > On 11/10/26 10:58, Yeoreum Yun wrote:
> > > Hi Rik,
> > >
> > > > On Mon, 2026-11-09 at 12:32 +0000, Yeoreum Yun wrote:
> > > > > This is preparatory patch to make gup_fast_pte_range()
> > > > > batchable.
> > > > >
> > > > > Introduce gup_unshared_pages() to count consecutive pages
> > > > > within a
> > > > > folio
> > > > > that do not require unsharing, and use it to implement
> > > > > gup_must_unshare().
> > > > >
> > > > Could gup_exclusive_pages() be a better name?
> > >
> > > Yes. This seems much better for me. I'll change it in next-spin.
> >
> > Not quite the right semantics. For pagecache folios we simply don't
> > need
> > unsharing in MAP_SHARED VMAs. That does not imply that these are
> > exclusive.
> >
> > So it's all about "number of pages that don't need unsharing".
> >
> gup_no_unshare_len() ?
>
> a little awkward sounding, but it describes
> what it's doing?
Hmm, Wouldn't this name be semantically much the same as keeping
the existing gup_unshared_page(), since both essentially convey that
no unsharing is required from GUP's perspective?
Anyway, naming is always NP-hard problem :\
--
Sincerely,
Yeoreum Yun