[PATCH v2 0/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev

Alban Crequy posted 2 patches 2 months, 1 week ago
There is a newer version of this series
MAINTAINERS                                   |   1 +
include/uapi/linux/process_vm.h               |   9 +
mm/process_vm_access.c                        |  24 +-
tools/testing/selftests/mm/Makefile           |   1 +
tools/testing/selftests/mm/process_vm_readv.c | 368 ++++++++++++++++++
5 files changed, 397 insertions(+), 6 deletions(-)
create mode 100644 include/uapi/linux/process_vm.h
create mode 100644 tools/testing/selftests/mm/process_vm_readv.c
[PATCH v2 0/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev
Posted by Alban Crequy 2 months, 1 week ago
This adds two flags to process_vm_readv/writev:

- PROCESS_VM_PIDFD: refer to the remote process via PID file descriptor
  instead of PID.
- PROCESS_VM_NOWAIT: do not block on IO if the memory access causes a
  page fault.

v1: https://lore.kernel.org/lkml/20251118132348.2415603-1-alban.crequy@gmail.com/

Changes since v1:
- Expand commit message with use-case motivation (David Hildenbrand)
- Use unsigned long consistently for pvm_flags parameter (David Hildenbrand)
- Add PROCESS_VM_SUPPORTED_FLAGS kernel-internal define (David Hildenbrand)
- Keep (1UL << N) in UAPI header: BIT() is defined in vdso/bits.h
  which is not exported to userspace, so UAPI headers using BIT() would
  break when included from userspace programs (David Hildenbrand)
- Add selftests (new patch 2/2)

Alban Crequy (2):
  mm/process_vm_access: pidfd and nowait support for
    process_vm_readv/writev
  selftests/mm: add tests for process_vm_readv flags

 MAINTAINERS                                   |   1 +
 include/uapi/linux/process_vm.h               |   9 +
 mm/process_vm_access.c                        |  24 +-
 tools/testing/selftests/mm/Makefile           |   1 +
 tools/testing/selftests/mm/process_vm_readv.c | 368 ++++++++++++++++++
 5 files changed, 397 insertions(+), 6 deletions(-)
 create mode 100644 include/uapi/linux/process_vm.h
 create mode 100644 tools/testing/selftests/mm/process_vm_readv.c

-- 
2.45.0
Re: [PATCH v2 0/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev
Posted by Christian Brauner 2 months ago
On Wed, Apr 08, 2026 at 04:54:34PM +0200, Alban Crequy wrote:
> This adds two flags to process_vm_readv/writev:
> 
> - PROCESS_VM_PIDFD: refer to the remote process via PID file descriptor
>   instead of PID.
> - PROCESS_VM_NOWAIT: do not block on IO if the memory access causes a
>   page fault.
> 
> v1: https://lore.kernel.org/lkml/20251118132348.2415603-1-alban.crequy@gmail.com/

Looks good to me,
Reviewed-by: Christian Brauner <brauner@kernel.org>