Re: [PATCH v3] mm: pgtable: protect lockless kernel page table walks with RCU
From: David CARLIER
Date: Fri Jun 12 2026 - 14:48:50 EST
> It's not teardown is it? The only caller is vmap_try_huge_pmd().
Right, it's the huge-pmd install collapsing the pte table, not teardown.
> And if !CONFIG_ASYNC_KERNEL_PGTABLE_FREE then ... everything's
broken again isn't it?
Yeah, that's the real bug. Non-async pagetable_free_kernel() frees
immediately, so the rcu_read_lock() does nothing. v3 only ever helped the
async config.
> now we're unconditionally waiting a grace period ... this seems... silly?
It only fires for kernel pte tables freed by the huge collapse and by
hot-remove, not every page table free. User pte tables already rcu-free,
this just does the same for the kernel ones.
> why the arm64 page table split path is safe
It only walks the range it's actively splitting, so nothing frees a table
under it. Same for the other walk_kernel_page_table_range() users. ptdump
walks the whole kernel range for the W+X check and can't take exclusive
access, so it's the one that races.
> I'd rather you add walk_kernel_page_table_range_rcu()
Will do.
Resend standalone in a day or two.