Re: (subset) [PATCH v6 0/4] mm/huge_memory: copy PMDs at fork like the PTE path does

From: David Hildenbrand

Date: Sun Nov 22 2026 - 12:00:37 EST


On Thu, 19 Nov 2026 14:44:01 +0100, Konstantin Khorenko wrote:
> v6 is rebased onto mm/core for-next, as David asked, and patch 2 was
> finished on the way: it now checks the page cache refcount limit before
> it copies a file folio, as copy_present_ptes() and copy_huge_pud() do
> since the refcount overflow fixes. So patch 2 changed after the
> Reviewed-by tags it carries.
>
> copy_huge_pmd() decides what to copy at fork by its own rules, apart
> from copy_present_ptes(): a lockless check for special PMDs, and a skip
> of every file THP. Following David's review of v3, this series makes it
> decide the way the PTE path does, under the page table lock, with
> vm_normal_page_pmd(). That fixes the two bugs v1-v3 were about. The
> patches:
>
> [...]

Applied, thanks!

tree: mm/core.git
branch: thp-7.5.misc

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/4] mm/rmap: duplicate a PMD mapping as one in folio_dup_file_rmap_pmd()
https://git.kernel.org/mm/core/c/4d47d354
[2/4] mm/huge_memory: copy file THPs at fork like copy_present_ptes() does
https://git.kernel.org/mm/core/c/e21c5cf9
[3/4] mm/huge_memory: read a special PMD under the lock in copy_huge_pmd()
https://git.kernel.org/mm/core/c/39b0669b

--
Cheers,

David