Re: [PATCH 1/2] mm/gup: pass an end address to follow_page_mask() and return a page count
From: Rik van Riel
Date: Wed Jul 29 2026 - 14:28:42 EST
On Wed, 2026-07-29 at 09:16 +0200, David Hildenbrand (Arm) wrote:
>
> This patch moves us closer towards the GUP-fast path, however, that
> is about to
> change:
>
>
> https://lore.kernel.org/all/20260219050250.266876166@xxxxxxxxx/
>
> With that in mind, I guess in the future we want to have:
>
> static long follow_page_mask(struct vm_area_struct *vma,
> unsigned long address, unsigned long end,
> unsigned int flags, struct page **pages)
>
> or even better, now that follow_page() no longer exists, in light of
> gup_fast():
>
>
> static long gup_slow(struct vm_area_struct *vma,
> unsigned long address, unsigned long end,
> unsigned int flags, struct page **pages)
>
> Returning the number of pinned pages.
>
>
> In particular, such an interface would allows us to process multiple
> ptes/pmds/... in one go, without having to restart the page table
> walk all the
> time for each non-batchable folio.
>
Let me give that a try. This looks like a very
nice optimization, and cleanup.
--
All Rights Reversed.