[PATCH v5 0/7] read proc/pid/smaps_rollup under per-vma lock
From: Suren Baghdasaryan
Date: Fri Sep 18 2026 - 11:57:01 EST
proc/pid/smaps_rollup can be read using the combination of RCU and
VMA read locks, similar to proc/pid/{maps|smaps|numa_maps}. RCU is
required to safely traverse the VMA tree and VMA lock stabilizes the
VMA being processed and the pagetable walk.
Note that we have to keep the logic to drop mmap_lock on contention
because even when using per-VMA locks we might have to fall back to
holding the mmap_lock.
The first 5 patches are cleanups making later change simpler. The main
change is in patch 6. Patch 7 extends existing proc-maps-race tearing
test to verify smaps_rollup content.
Changes since v4 [1]:
Patch 2:
- Fixed warnings with CONFIG_PROC_PAGE_MONITOR=n
- Fixed a typo in the changelog
Patch 3:
- Add Reviewed-by and Acked-by, per Lorenzo Stoakes and
David Hildenbrand
Patch 3:
- Add Reviewed-by and Acked-by, per Lorenzo Stoakes and
David Hildenbrand
[1] https://lore.kernel.org/all/20260911194145.1781926-1-surenb@xxxxxxxxxx/
Suren Baghdasaryan (7):
proc/task_mmu: remove unnecessary helpers
proc/task_mmu: remove unnecessary inlines in function definitions
proc/task_mmu: clarify shmem mapping walk conditions in
smap_gather_stats()
proc/task_mmu: remove special-casing of smap_gather_stats() start
parameter
proc/task_mmu: change proc_get_vma() to stop returning gate VMA at the
end
proc/task_mmu: read proc/pid/smaps_rollup under per-vma lock
selftests/proc: add /proc/pid/smaps_rollup tearing tests
fs/proc/task_mmu.c | 341 ++++++++----------
tools/testing/selftests/proc/proc-maps-race.c | 186 +++++++++-
2 files changed, 336 insertions(+), 191 deletions(-)
base-commit: 854157fc9d011b8dd5a1a86a237447e28d681eb9
--
2.55.0.1082.g2b9226bbc0-goog