public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Optimize posix_spawn signal setup with clone3
@ 2022-09-28 20:46 Adhemerval Zanella
  2022-09-28 20:46 ` [PATCH 1/7] linux: Do set signal handler if it is already SIG_DFL Adhemerval Zanella
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2022-09-28 20:46 UTC (permalink / raw)
  To: libc-alpha, Christian Brauner

Currently posix_spawn has to issue at least NSIG sigaction syscalls
to obtain current signal disposition and more if there are not
either SIG_IGN or SIG_DFL.  The clone3 CLONE_CLEAR_SIGHAND reset
all signal handlers of the child not set to SIG_IGN to SIG_DFL, thus
allowing to skip the preparation phase.

The exception is the signals defined by posix_spawnattr_setsigdefault
when POSIX_SPAWN_SETSIGDEF is set, since they can be SIG_IGN.

The patchset also adds clone3 implementation for aarch64, powerpc64,
s390x, and riscv.

Adhemerval Zanella (7):
  linux: Do set signal handler if it is already SIG_DFL
  linux: Add clone3 CLONE_CLEAR_SIGHAND optimization to posix_spawn
  powerpc64le: Add the clone3 wrapper
  aarch64: Add the clone3 wrapper
  s390x: Add the clone3 wrapper
  riscv: Add the clone3 wrapper
  Linux: optimize clone3 internal usage

 include/clone_internal.h                      |  10 +
 posix/Makefile                                |   3 +-
 posix/tst-spawn7.c                            | 177 ++++++++++++++++++
 sysdeps/unix/sysv/linux/aarch64/clone3.S      |  90 +++++++++
 sysdeps/unix/sysv/linux/aarch64/sysdep.h      |   2 +
 sysdeps/unix/sysv/linux/clone-internal.c      |  61 ++++--
 sysdeps/unix/sysv/linux/clone3.h              |   6 +
 sysdeps/unix/sysv/linux/kernel-features.h     |   8 +
 .../sysv/linux/powerpc/powerpc64/clone3.S     | 145 ++++++++++++++
 sysdeps/unix/sysv/linux/powerpc/sysdep.h      |   1 +
 sysdeps/unix/sysv/linux/riscv/clone3.S        |  83 ++++++++
 sysdeps/unix/sysv/linux/riscv/sysdep.h        |   1 +
 sysdeps/unix/sysv/linux/s390/s390-64/clone3.S |  84 +++++++++
 sysdeps/unix/sysv/linux/s390/sysdep.h         |   1 +
 sysdeps/unix/sysv/linux/spawni.c              |  33 +++-
 15 files changed, 679 insertions(+), 26 deletions(-)
 create mode 100644 posix/tst-spawn7.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/clone3.S
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/clone3.S
 create mode 100644 sysdeps/unix/sysv/linux/riscv/clone3.S
 create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/clone3.S

-- 
2.34.1


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

end of thread, other threads:[~2022-09-28 20:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 20:46 [PATCH 0/7] Optimize posix_spawn signal setup with clone3 Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 1/7] linux: Do set signal handler if it is already SIG_DFL Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 2/7] linux: Add clone3 CLONE_CLEAR_SIGHAND optimization to posix_spawn Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 3/7] powerpc64le: Add the clone3 wrapper Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 4/7] aarch64: " Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 5/7] s390x: " Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 6/7] riscv: " Adhemerval Zanella
2022-09-28 20:46 ` [PATCH 7/7] Linux: optimize clone3 internal usage Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).