Re: [PATCH] mm/rmap: don't discard lazyfree THPs at PMD level
From: David Hildenbrand (Arm)
Date: Mon Oct 12 2026 - 06:56:23 EST
On 10/10/26 04:08, Zi Yan wrote:
> __discard_anon_folio_pmd_locked() clears a lazyfree THP PMD before it knows
> whether the folio can be discarded, and restores it if the folio was
> redirtied or has extra references. A concurrent munmap() or
> MREMAP_DONTUNMAP skips the temporary none PMD and unlinks the VMA from its
> anon_vma, so the folio stays mapped after the anon_vma is freed and a later
> rmap walk uses the freed anon_vma.
>
> Using an invalidated PMD instead of a cleared one requires additional arch
> code fixes. Instead, disable the PMD level discard of lazyfree THPs, as
> before commit 735ecdfaf4e8 ("mm/vmscan: avoid split lazyfree THP during
> shrink_folio_list()").
>
Maybe mention here that we leave the infrastructure around to re-enable it once
fixes?
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David