Re: [PATCH v3 5/6] mm: gup: introduce gup_unshared_pages()

From: Rik van Riel

Date: Tue Nov 10 2026 - 00:27:15 EST


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?

The code all looks good, though.

> Also add a folio argument to gup_must_unshare() so callers can reuse
> an
> existing folio and avoid the compound_head() call implicit in
> PageAnon().

Does that count as a functional change? ;)

>
> There is no functional change.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>

Reviewed-by: Rik van Riel <riel@xxxxxxxxxxx>

--
All Rights Reversed.