Skip to content

execute PROCMAP_QUERY ioctl under per-vma lock

Suren Baghdasaryan linux-fsdevel linux-kselftest linux-mm lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 8 repliesIn review
  2. v33 patches 7 repliesSuperseded
  3. v23 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3selftests/proc: test PROCMAP_QUERY ioctl while vma is concurrently modifiedtools/testing/selftests/proc/proc-maps-race.c+65 -03 replies
2/3fs/proc/task_mmu: factor out proc_maps_private fields used by PROCMAP_QUERYfs/proc/internal.h fs/proc/task_mmu.c fs/proc/task_nommu.c+63 -531 reply
3/3fs/proc/task_mmu: execute PROCMAP_QUERY ioctl under per-vma locksfs/proc/task_mmu.c+85 -184 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSeongJae ParkVlastimil BabkaAndrii NakryikoLorenzo Stoakes
1/3T-b A-b R-b
2/3A-b R-b R-b
3/3A-b R-b A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/3] execute PROCMAP_QUERY ioctl under per-vma lock

With /proc/pid/maps now being read under per-vma lock protection we can reuse parts of that code to execute PROCMAP_QUERY ioctl also without taking mmap_lock. The change is designed to reduce mmap_lock contention and prevent PROCMAP_QUERY ioctl calls from blocking address space updates.

This patchset was split out of the original patchset [1] that introduced per-vma lock usage for /proc/pid/maps reading. It contains PROCMAP_QUERY tests, code refactoring patch to simplify the main change and the actual transition to per-vma lock.

Changes since v3 [2]
- change lock_vma_range()/unlock_vma_range() parameters,
per Lorenzo Stoakes
- minimize priv->lock_ctx dereferences by storing it in a local variable, per Lorenzo Stoakes
- rename unlock_vma to unlock_ctx_vma, per Lorenzo Stoakes
- factored out reset_lock_ctx(), per Lorenzo Stoakes
- reset lock_ctx->mmap_locked inside query_vma_teardown(), per Lorenzo Stoakes
- add clarifying comments in query_vma_find_by_addr() and procfs_procmap_ioctl(), per Lorenzo Stoakes
- refactored error handling code inside query_vma_find_by_addr(), per Lorenzo Stoakes
- add Acked-by as changes were cosmetic, per SeongJae Park

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Suren Baghdasaryan (3):
selftests/proc: test PROCMAP_QUERY ioctl while vma is concurrently
modified
fs/proc/task_mmu: factor out proc_maps_private fields used by
PROCMAP_QUERY
fs/proc/task_mmu: execute PROCMAP_QUERY ioctl under per-vma locks

 fs/proc/internal.h                            |  15 +-
 fs/proc/task_mmu.c                            | 184 ++++++++++++------
 fs/proc/task_nommu.c                          |  14 +-
 tools/testing/selftests/proc/proc-maps-race.c |  65 +++++++
 4 files changed, 210 insertions(+), 68 deletions(-)

base-commit: c2144e09b922d422346a44d72b674bf61dbd84c0

Signature · 1 line
2.50.1.703.g449372360f-goog