Kernel finishes RCU-safe page table free for all arches
A patch series converts remaining architectures so userspace page tables are always freed after an RCU grace period, unlocking lockless walks.
Lorenzo Stoakes has posted a series that finishes converting every architecture so the kernel frees userspace page tables only after an RCU grace period, then drops the old opt-in configuration entirely.
Most architectures already deferred that free. The remaining ones did not. Until they did, page-table walkers could not rely on RCU alone; concurrent teardown could free tables out from under them. The change makes lockless RCU walks safe kernel-wide. That cuts lock contention, sidesteps lock-ordering problems, and lets walkers run without taking the page-table lock solely for lifetime protection.
The work also fixes a related hazard in transparent huge-page collapse. collapse_huge_page() used to deposit the PTE table that was still mapped by the PMD being collapsed, so a later split of an unrelated PMD could reuse it. Ordinary walkers were protected by heavier locks and an IPI; pure RCU walkers would not be. The series now allocates a fresh zeroed PTE table to deposit and RCU-frees the old one, matching every other deposit path.
With every architecture converted, the series removes CONFIG_MMU_GATHER_RCU_TABLE_FREE and the dead non-RCU paths that hung off it. Kernel policy is now uniform: userspace page tables survive an RCU grace period. Read-only walkers that hold the mm alive may therefore traverse ranges that are being torn down, provided they revalidate entries after taking the proper lock before acting on them. Writers still need the page-table lock and a lock that excludes teardown.
The conversion builds on earlier work by Hugh Dickins, Qi Zheng, Lance Yang and others that introduced deferred free helpers and moved most architectures onto them. Stoakes’s series closes the last gaps, including awkward cases such as slab-allocated or shared backing page tables on certain SuperH, m68k and sparc variants.