On 2/5/26 17:30, Lance Yang wrote:
On 2026/2/5 23:41, Dave Hansen wrote:
On 2/5/26 07:31, Lance Yang wrote:
Without IPIs or synchronize_rcu(), IIUC, we have no way to know if there
are ongoing concurrent lockless page-table walks — the walkers just
disable
IRQs and walk.
Yeah, but one aim of RCU is ensuring that readers see valid data but not
necessarily the most up to date data.
Are there cases where ongoing concurrent lockless page-table walks need
to see the writes and they can't tolerate seeing valid but slightly
stale data?
The issue is we're about to free the page table (e.g.
pmdp_collapse_flush()).
We have to ensure no walker is still doing a lockless page-table walk
when the page directories are freed, otherwise we get use-after-free.
Right, and walking a page table that is suddenly no longer a page table
is the real fun :)
... or trying to lookup the page of something that is not even a page.
Don't forget that we also have pesky concurrent lockless page-table
walkers called CPUs. They're extra pesky in that they don't even stop
for IPIs. ;)
I assume those walkers that don't disable IRQs only read the PMD and
don't walk into the table; otherwise the current sync wouldn't work
for them.
CPU page table walkers are much easier to control in that regard :)
--
Cheers,
David