Skip to content

mm: __access_remote_vm with per-VMA lock

Rik van Riel linux-mm lkml 2 versions – NAK

Status from this message: NAK

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 12 repliesNAK
  2. v13 patches 20 repliesSuperseded

Changes in v2 from the cover letter

- simplify the code, which should be ok because these copies are < PAGE_SIZE
- clean up the code
- fix locking wrt tlb_remove_table_sync_one()
- hopefully address all the other comments

Patches in v2

#Subject and filesSizeRepliesApplied
1/3x86/mm: use READ_ONCE/WRITE_ONCE for mm->context.untag_maskarch/x86/include/asm/mmu_context.h arch/x86/include/asm/uaccess_64.h arch/x86/kernel/process_64.c+5 -50 replies
2/3mm/pagewalk: let folio_walk_start() run under the per-VMA lockinclude/linux/pagewalk.h mm/pagewalk.c+34 -24 replies
3/3mm: read remote memory without the mmap lock where possiblearch/x86/include/asm/uaccess_64.h include/linux/uaccess.h mm/memory.c+217 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] mm: __access_remote_vm with per-VMA lock

Sometimes processes can get stuck with the mmap_lock held for a long time. This slows down, and can even prevent system monitoring tools from assessing and logging the situation, because they themselves end up getting stuck on the mmap_lock.

However, with the introduction of per-VMA locks, we can improve the reliability of system monitoring, and generally speed up __access_remote_vm under mmap_loc contention, by adding a fast path that does not require the process-wide mmap_lock.

This fast path is only compiled in and used when it is safe to do so, meaning a kernel with per-VMA locks, RCU pgae table freeing, the VMA is not hugetlbfs, iomap, pfnmap, etc...

v2:
- simplify the code, which should be ok because these copies are < PAGE_SIZE
- clean up the code
- fix locking wrt tlb_remove_table_sync_one()
- hopefully address all the other comments