Re: [PATCH v2] mm: synchronize with PTE table reclaim for all folio sizes
From: David Hildenbrand (Arm)
Date: Tue Nov 17 2026 - 04:08:29 EST
On 11/17/26 05:27, Andrew Morton wrote:
> On Tue, 17 Nov 2026 11:40:22 +0800 Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> wrote:
>
>> Similar to commit 243cf1f67b36 ("mm: memory: fix truncation removing mapped
>> folios"), the '!pmd_present()' check in page_vma_mapped_walk() can also race
>> with concurrent page table reclamation via zap_empty_pte_table().
>>
>> page_vma_mapped_walk() is used by many functions including try_to_unmap(),
>> try_to_migrate(), folio_mkclean(), pfn_mkclean_range(), remove_migration_ptes(),
>> page_mapped_in_vma(), and mapping_wrprotect_range(). Except for try_to_unmap()
>> and try_to_migrate(), the other callers do not perform post-walk accounting
>> checks, so the race has no observable impact on them.
>>
>> For migration, the race can cause unnecessary retries. For reclaim via
>> try_to_unmap(), the race can cause failure to reclaim a folio that is in
>> fact already unmapped (as shown below), which may cause cold/hot inversion
>> (e.g., in MGLRU) and increase refaults. In extreme cases, failing to
>> reclaim unmapped large folios could even cause OOM in theory.
>
> Thanks, I've updated mm-hotfixes-unstable to this version.
Please drop it.
I'll take care of it.
It would be good to delay picking stuff that I will pick once ready.
--
Cheers,
David