Re: [PATCH v4 0/6] mm: gup: batch PTE-mapped large folios in gup_fast_pte_range()

From: David Hildenbrand

Date: Wed Nov 11 2026 - 02:42:25 EST


On Tue, 10 Nov 2026 22:52:50 +0000, Yeoreum Yun wrote:
> GUP-fast grabs a PTE-mapped large folio one page at a time. Every PTE
> costs a try_grab_folio_fast() (a refcount cmpxchg, plus the pincount
> atomic, a full barrier and a node stat update for FOLL_PIN), a
> gup_fast_folio_allowed() and a folio_set_referenced(), so a 64 kB mTHP
> pays sixteen of each and a PTE-mapped 2 MB THP pays 512.
>
> The users are the hot ones: iov_iter_extract_user_pages() pins every
> O_DIRECT buffer through pin_user_pages_fast(), io_uring registers its
> buffers through it, and so does RDMA memory registration.
> With mTHP those buffers are PTE-mapped large folios.
>
> [...]

Applied, thanks!

tree: mm/core.git
branch: gup-7.5.ptebatch

Applied patches will appear soon in mm-next, followed by linux-next.

Please report any outstanding bugs that were missed during review, so we
can either drop the patch series or decide how to fix it up.

It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even
though the patches have already been applied. If possible, patch trailers
will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. Further, this is not a guarantee that the
patches will go upstream. If in doubt, please check the listed branch.

[1/6] mm: khugepaged: ignore MADV_HUGEPAGE for shadow stacks
https://git.kernel.org/mm/core/c/0d100a39
[2/6] mm: gup: clarify a reason to check pte/pmd in gup_fast_pte_range()
https://git.kernel.org/mm/core/c/6ae9ffb6
[3/6] mm: gup: move gup_must_unshare() and INTERNAL_GUP_FLAGS to gup.c
https://git.kernel.org/mm/core/c/831549f9
[4/6] mm: internal: introduce FPB_LOCKLESS for folio_pte_batch_flags()
https://git.kernel.org/mm/core/c/300a252f
[5/6] mm: gup: introduce gup_pages_not_requiring_unshare()
https://git.kernel.org/mm/core/c/1b3ad4f2
[6/6] mm: gup: batch PTE-mapped large folios in gup_fast_pte_range()
https://git.kernel.org/mm/core/c/3d738020

--
Cheers,

David