[PATCH 0/3] use vma locks for proc/pid/{smaps|numa_maps} reads
From: Suren Baghdasaryan
Date: Fri Apr 24 2026 - 03:07:52 EST
Use per-vma locks when reading /proc/pid/smaps and /proc/pid/numa_maps
similar to /proc/pid/maps to reduce contention on central mmap_lock. One
major difference between maps and smaps/numa_maps reading is that the
latter executes page table walk which can't be done under RCU due to a
possibility of sleeping. Therefore we drop RCU read lock before this walk
while keeping the VMA locked. After the walk we retake RCU read lock,
reset VMA iterator and proceed with the next VMA.
The last two patches extend /proc/pid/maps test to cover /proc/pid/smaps
reading during concurrent address space modification.
Applies over mm-unstable.
Suren Baghdasaryan (3):
fs/proc/task_mmu: read proc/pid/{smaps|numa_maps} under per-vma lock
selftests/proc: ensure the test is performed at the right page
boundary
selftests/proc: add /proc/pid/smaps tearing tests
fs/proc/task_mmu.c | 193 ++++++++++---
tools/testing/selftests/proc/proc-maps-race.c | 254 ++++++++++++++----
2 files changed, 354 insertions(+), 93 deletions(-)
base-commit: a22b29c0b1a2a245ef5f782d7456de3c76eb135f
--
2.54.0.545.g6539524ca2-goog