Re: [PATCH v3 01/12] mm/huge_memory: zap deposited page tables after an RCU grace period
From: David Hildenbrand (Arm)
Date: Wed Sep 16 2026 - 11:03:19 EST
On 9/11/26 21:36, Lorenzo Stoakes (ARM) wrote:
> When an anonymous mapping is collapsed for THP, a PTE page table is
> 'deposited' with the installed PMD entry.
Right. Or when we allocate an anon THP.
>
> This is done in order that a split can be performed without needing to
> allocate additional memory.
>
> The freeing occurs in zap_deposited_table() and is done directly without
> any delay via pte_free().
>
> This is currently not a problem as existing page table walks are protected
> by the mmap or anon rmap lock.
Or VMA lock?
>
> However this becomes problematic in a future where RCU-only page table
> walkers exist, as there is nothing to prevent a page table walker that
> started the walk prior to collapse having its PTE table freed underneath
> it.
Wait, but wouldn't it be really problematic to punch a page table that is still
being walked into the deposited list where it can just be allocated from another
PMD->PTE split?
Note that pgtable_trans_huge_withdraw() just dequeues *some* PTE page table in
the list attached to the PMD table.
Something is odd here.
--
Cheers,
David