linux-stable/tools/testing/selftests
Linus Torvalds 4da9af0014 threads-v5.10
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCX4a4sAAKCRCRxhvAZXjc
 ohdRAP9fclgrRkTl3o4cgaK0PUMt8BZ5QCg/SPQrVT58AQlfSwEAsNtWAeo6U2z1
 FLGuCoPBEW1Zghkj1lMbIhj5zyVaEQ8=
 =Z7Q0
 -----END PGP SIGNATURE-----

Merge tag 'threads-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux

Pull pidfd updates from Christian Brauner:
 "This introduces a new extension to the pidfd_open() syscall. Users can
  now raise the new PIDFD_NONBLOCK flag to support non-blocking pidfd
  file descriptors. This has been requested for uses in async process
  management libraries such as async-pidfd in Rust.

  Ever since the introduction of pidfds and more advanced async io
  various programming languages such as Rust have grown support for
  async event libraries. These libraries are created to help build
  epoll-based event loops around file descriptors. A common pattern is
  to automatically make all file descriptors they manage to O_NONBLOCK.

  For such libraries the EAGAIN error code is treated specially. When a
  function is called that returns EAGAIN the function isn't called again
  until the event loop indicates the the file descriptor is ready.
  Supporting EAGAIN when waiting on pidfds makes such libraries just
  work with little effort.

  This introduces a new flag PIDFD_NONBLOCK that is equivalent to
  O_NONBLOCK. This follows the same patterns we have for other (anon
  inode) file descriptors such as EFD_NONBLOCK, IN_NONBLOCK,
  SFD_NONBLOCK, TFD_NONBLOCK and the same for close-on-exec flags.

  Passing a non-blocking pidfd to waitid() currently has no effect, i.e.
  is not supported. There are users which would like to use waitid() on
  pidfds that are O_NONBLOCK and mix it with pidfds that are blocking
  and both pass them to waitid().

  The expected behavior is to have waitid() return -EAGAIN for
  non-blocking pidfds and to block for blocking pidfds without needing
  to perform any additional checks for flags set on the pidfd before
  passing it to waitid(). Non-blocking pidfds will return EAGAIN from
  waitid() when no child process is ready yet. Returning -EAGAIN for
  non-blocking pidfds makes it easier for event loops that handle EAGAIN
  specially.

  It also makes the API more consistent and uniform. In essence,
  waitid() is treated like a read on a non-blocking pidfd or a recvmsg()
  on a non-blocking socket.

  With the addition of support for non-blocking pidfds we support the
  same functionality that sockets do. For sockets() recvmsg() supports
  MSG_DONTWAIT for pidfds waitid() supports WNOHANG. Both flags are
  per-call options. In contrast non-blocking pidfds and non-blocking
  sockets are a setting on an open file description affecting all
  threads in the calling process as well as other processes that hold
  file descriptors referring to the same open file description. Both
  behaviors, per call and per open file description, have genuine
  use-cases.

  The interaction with the WNOHANG flag is documented as follows:

   - If a non-blocking pidfd is passed and WNOHANG is not raised we
     simply raise the WNOHANG flag internally. When do_wait() returns
     indicating that there are eligible child processes but none have
     exited yet we set EAGAIN. If no child process exists we continue
     returning ECHILD.

   - If a non-blocking pidfd is passed and WNOHANG is raised waitid()
     will continue returning 0, i.e. it will not set EAGAIN. This ensure
     backwards compatibility with applications passing WNOHANG
     explicitly with pidfds"

* tag 'threads-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
  tests: remove O_NONBLOCK before waiting for WSTOPPED
  tests: add waitid() tests for non-blocking pidfds
  tests: port pidfd_wait to kselftest harness
  pidfd: support PIDFD_NONBLOCK in pidfd_open()
  exit: support non-blocking pidfds
2020-10-14 14:39:20 -07:00
..
android
arm64 Merge branch 'for-next/late-arrivals' into for-next/core 2020-10-07 14:36:24 +01:00
bpf selftests/bpf: Add bpf_{update, delete}_map_elem in hashmap iter program 2020-09-03 17:36:41 -07:00
breakpoints selftests: breakpoints: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:47:48 -06:00
capabilities
cgroup kselftests: cgroup: add perpcu memory accounting test 2020-08-12 10:57:55 -07:00
clone3 selftests/clone3: Avoid OS-defined clone_args 2020-10-08 13:17:25 -07:00
core tests: add CLOSE_RANGE_UNSHARE tests 2020-06-17 00:07:38 +02:00
cpu-hotplug
cpufreq
dmabuf-heaps
drivers selftests: mlxsw: RED: Test offload of trapping on RED qevents 2020-08-03 18:06:46 -07:00
efivarfs
exec selftests/exec: add file type errno tests 2020-08-14 19:56:56 -07:00
filesystems selftests/binderfs: Fix harness API usage 2020-07-06 15:59:16 -06:00
firmware selftest/firmware: Add selftest timeout in settings 2020-07-25 12:05:20 +02:00
fpu selftests/fpu: Add an FPU selftest 2020-06-29 10:02:23 +02:00
ftrace tracing: switch to kernel_clone() 2020-08-20 13:12:59 +02:00
futex
gpio
ia64
intel_pstate
ipc
ir
kcmp
kexec
kmod selftests: kmod: use variable NAME in kmod_test_0001() 2020-08-12 10:58:01 -07:00
kselftest Driver core changes for 5.9-rc1 2020-08-05 11:52:17 -07:00
kvm selftests: kvm: Fix assert failure in single-step test 2020-09-23 10:23:56 -04:00
lib lib: make a test module with set/clear bit 2020-06-04 19:06:25 -07:00
livepatch selftests/livepatch: adopt to newer sysctl error format 2020-07-15 08:54:35 +02:00
lkdtm lkdtm: Make arch-specific tests always available 2020-06-29 18:41:39 +02:00
locking
media_tests
membarrier
memfd
memory-hotplug
mincore selftests: add mincore() tests 2020-08-07 11:33:27 -07:00
mount
mqueue
net selftests: rtnetlink: Test bridge enslavement with different parent IDs 2020-09-10 15:06:48 -07:00
netfilter selftests: netfilter: add command usage 2020-08-28 20:12:00 +02:00
nsfs
ntb NTB: ntb_test: Fix bug when counting remote files 2020-06-05 20:02:09 -04:00
openat2
pid_namespace selftests: Remove unneeded selftest API headers 2020-07-06 15:59:07 -06:00
pidfd threads-v5.10 2020-10-14 14:39:20 -07:00
powerpc * Extend the recovery from MCE in kernel space also to processes which 2020-10-12 10:14:38 -07:00
prctl
proc
pstore pstore/platform: Use backend name for console registration 2020-05-30 10:34:02 -07:00
ptp testptp: add new options for perout phase and pulse width 2020-07-20 18:04:59 -07:00
ptrace
rcutorture Merge branches 'doc.2020.06.29a', 'fixes.2020.06.29a', 'kfree_rcu.2020.06.29a', 'rcu-tasks.2020.06.29a', 'scale.2020.06.29a', 'srcu.2020.06.29a' and 'torture.2020.06.29a' into HEAD 2020-06-29 12:03:15 -07:00
resctrl
rseq rseq/selftests: Test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ 2020-09-25 14:23:27 +02:00
rtc
safesetid
seccomp selftests/clone3: Avoid OS-defined clone_args 2020-10-08 13:17:25 -07:00
sigaltstack selftests: sigaltstack: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:57:15 -06:00
size
sparc64
splice selftests: splice: Check behavior of full and short splices 2020-08-07 10:50:11 -07:00
static_keys
sync selftests: sync_test: do not use ksft_exit_skip after ksft_set_plan 2020-07-06 15:57:28 -06:00
sysctl linux-kselftest-5.8-rc1 2020-06-09 10:03:12 -07:00
tc-testing tc-testing: Add tdc to kselftests 2020-07-20 18:29:37 -07:00
timens
timers selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
tmpfs
tpm2 selftests: tpm: upgrade TPM2 tests from Python 2 to Python 3 2020-07-06 14:20:35 -06:00
uevent selftests: Remove unneeded selftest API headers 2020-07-06 15:59:07 -06:00
user
vDSO
vm linux-kselftest-fixes-5.10-rc1 2020-10-14 14:23:51 -07:00
watchdog
wireguard wireguard: device: avoid circular netns references 2020-06-23 14:50:34 -07:00
x86 * Misc minor cleanups and corrections to the fsgsbase code and 2020-10-12 10:44:24 -07:00
zram
.gitignore
Makefile selftests: add mincore() tests 2020-08-07 11:33:27 -07:00
gen_kselftest_tar.sh
kselftest.h linux-kselftest-5.9-rc1 2020-08-05 10:28:25 -07:00
kselftest_deps.sh
kselftest_harness.h selftests/harness: Flush stdout before forking 2020-09-17 17:33:39 -06:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: fix condition in run_tests 2020-07-07 14:11:31 -06:00