public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH 0/3] use vma locks for proc/pid/{smaps|numa_maps} reads
@ 2026-04-24  7:02 Suren Baghdasaryan
  2026-04-24  7:02 ` [PATCH 1/3] fs/proc/task_mmu: read proc/pid/{smaps|numa_maps} under per-vma lock Suren Baghdasaryan
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Suren Baghdasaryan @ 2026-04-24  7:02 UTC (permalink / raw)
  To: akpm
  Cc: liam, ljs, vbabka, david, willy, jannh, paulmck, pfalcato, shuah,
	hsukrut3, richard.weiyang, reddybalavignesh9979, linux-mm,
	linux-kernel, linux-fsdevel, linux-kselftest, surenb

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-04-25 23:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24  7:02 [PATCH 0/3] use vma locks for proc/pid/{smaps|numa_maps} reads Suren Baghdasaryan
2026-04-24  7:02 ` [PATCH 1/3] fs/proc/task_mmu: read proc/pid/{smaps|numa_maps} under per-vma lock Suren Baghdasaryan
2026-04-24 18:19   ` Liam R. Howlett
2026-04-24  7:02 ` [PATCH 2/3] selftests/proc: ensure the test is performed at the right page boundary Suren Baghdasaryan
2026-04-24 18:21   ` Liam R. Howlett
2026-04-24 19:58     ` Suren Baghdasaryan
2026-04-24  7:02 ` [PATCH 3/3] selftests/proc: add /proc/pid/smaps tearing tests Suren Baghdasaryan
2026-04-24 18:23   ` Liam R. Howlett
2026-04-24 19:59     ` Suren Baghdasaryan
2026-04-25 23:48       ` Suren Baghdasaryan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox