All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] pidfd: waiting on processes through pidfds
@ 2019-07-24 14:46 Christian Brauner
  2019-07-24 14:46 ` [RFC][PATCH 1/5] exit: kill struct waitid_info Christian Brauner
                   ` (4 more replies)
  0 siblings, 5 replies; 42+ messages in thread
From: Christian Brauner @ 2019-07-24 14:46 UTC (permalink / raw)
  To: linux-kernel, oleg
  Cc: arnd, ebiederm, keescook, joel, tglx, tj, dhowells, jannh, luto,
	akpm, cyphar, torvalds, viro, kernel-team, Christian Brauner

Hey everyone,

This adds the ability to wait on processes using pidfds. This is one of
the few missing pieces to make it possible to manage processes using
only pidfds.

pidfd_wait() does explicitly not allow scoping of the process referred
to by the pidfd, i.e. generic wait requests such as P_PGID and P_ALL and
other trickery such as passing in negative values and so on is not
supported.

The series also adds support for CLONE_WAIT_PID which prevents the
process referred to by the pidfd to appear in generic wait requests
similar to what is the default in FreeBSD.
This feature has been requested multiple times when I gave talks about
this work (for extensions see [1]).

The syscall patch is rather small overall. The largest portion of this
series are the tests and the cleanup to remove struct waitid_info from
exit.c.

Thanks!
Christian

[1]: In the future, we might add something like
     CLONE_WAIT_STATUS_FOREIGN (or some better name).
     Such pidfds will allow anyone to retrieve the exit status of a
     non-parent process by calling pidfd_wait() on it without reaping
     it. This has also been requested quite often and fits nicely into
     the api. But that's for a later patchset.

Christian Brauner (5):
  exit: kill struct waitid_info
  pidfd: add pidfd_wait()
  arch: wire-up pidfd_wait()
  pidfd: add CLONE_WAIT_PID
  pidfd: add pidfd_wait tests

 arch/alpha/kernel/syscalls/syscall.tbl      |   1 +
 arch/arm/tools/syscall.tbl                  |   1 +
 arch/arm64/include/asm/unistd.h             |   2 +-
 arch/arm64/include/asm/unistd32.h           |   4 +-
 arch/ia64/kernel/syscalls/syscall.tbl       |   1 +
 arch/m68k/kernel/syscalls/syscall.tbl       |   1 +
 arch/microblaze/kernel/syscalls/syscall.tbl |   1 +
 arch/mips/kernel/syscalls/syscall_n32.tbl   |   1 +
 arch/mips/kernel/syscalls/syscall_n64.tbl   |   1 +
 arch/mips/kernel/syscalls/syscall_o32.tbl   |   1 +
 arch/parisc/kernel/syscalls/syscall.tbl     |   1 +
 arch/powerpc/kernel/syscalls/syscall.tbl    |   1 +
 arch/s390/kernel/syscalls/syscall.tbl       |   1 +
 arch/sh/kernel/syscalls/syscall.tbl         |   1 +
 arch/sparc/kernel/syscalls/syscall.tbl      |   1 +
 arch/x86/entry/syscalls/syscall_32.tbl      |   1 +
 arch/x86/entry/syscalls/syscall_64.tbl      |   1 +
 arch/xtensa/kernel/syscalls/syscall.tbl     |   1 +
 include/linux/pid.h                         |   5 +
 include/linux/sched.h                       |   1 +
 include/linux/syscalls.h                    |   4 +
 include/uapi/asm-generic/unistd.h           |   4 +-
 include/uapi/linux/sched.h                  |   1 +
 kernel/exit.c                               | 191 ++++++----
 kernel/fork.c                               |  19 +-
 kernel/signal.c                             |   7 +-
 tools/testing/selftests/pidfd/pidfd.h       |  25 ++
 tools/testing/selftests/pidfd/pidfd_test.c  |  14 -
 tools/testing/selftests/pidfd/pidfd_wait.c  | 398 ++++++++++++++++++++
 29 files changed, 606 insertions(+), 85 deletions(-)
 create mode 100644 tools/testing/selftests/pidfd/pidfd_wait.c

-- 
2.22.0


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

end of thread, other threads:[~2019-07-26 12:37 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 14:46 [PATCH 0/5] pidfd: waiting on processes through pidfds Christian Brauner
2019-07-24 14:46 ` [RFC][PATCH 1/5] exit: kill struct waitid_info Christian Brauner
2019-07-24 17:37   ` Linus Torvalds
2019-07-24 22:01     ` Christian Brauner
2019-07-25 12:46     ` Eric W. Biederman
2019-07-26  8:01       ` Christian Brauner
2019-07-26 11:59         ` Eric W. Biederman
2019-07-26 12:37           ` Christian Brauner
2019-07-25  9:40   ` Oleg Nesterov
2019-07-25 10:07     ` Christian Brauner
2019-07-24 14:46 ` [PATCH 2/5] pidfd: add pidfd_wait() Christian Brauner
2019-07-24 17:45   ` Linus Torvalds
2019-07-24 17:50     ` Christian Brauner
2019-07-24 17:52       ` Christian Brauner
2019-07-25 14:34     ` Eric W. Biederman
2019-07-25 10:16   ` Oleg Nesterov
2019-07-25 10:21     ` Christian Brauner
2019-07-26  8:19   ` Arnd Bergmann
2019-07-26  8:24     ` Christian Brauner
2019-07-26  9:57       ` Arnd Bergmann
2019-07-24 14:46 ` [PATCH 3/5] arch: wire-up pidfd_wait() Christian Brauner
2019-07-24 14:46   ` Christian Brauner
2019-07-24 14:46   ` Christian Brauner
2019-07-24 14:46   ` Christian Brauner
2019-07-24 14:46 ` [PATCH 4/5] pidfd: add CLONE_WAIT_PID Christian Brauner
2019-07-24 18:14   ` Jann Horn
2019-07-24 18:27     ` Christian Brauner
2019-07-24 19:07       ` Jann Horn
2019-07-24 19:10         ` Christian Brauner
2019-07-25 10:11           ` Christian Brauner
2019-07-25 10:30         ` Oleg Nesterov
2019-07-25 10:36           ` Christian Brauner
2019-07-25 10:35   ` Oleg Nesterov
2019-07-25 10:40     ` Christian Brauner
2019-07-25 11:25       ` Oleg Nesterov
2019-07-25 11:41         ` Christian Brauner
2019-07-25 11:43         ` Oleg Nesterov
2019-07-25 12:26           ` Christian Brauner
2019-07-25 16:13             ` Oleg Nesterov
2019-07-25 16:56               ` Christian Brauner
2019-07-25 16:57             ` Eric W. Biederman
2019-07-24 14:46 ` [PATCH 5/5] pidfd: add pidfd_wait tests Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.