freebsd-skq/sys/compat
Konstantin Belousov 146fc63fce Add a way to manage thread signal mask using shared word, instead of syscall.
A new syscall sigfastblock(2) is added which registers a uint32_t
variable as containing the count of blocks for signal delivery.  Its
content is read by kernel on each syscall entry and on AST processing,
non-zero count of blocks is interpreted same as the signal mask
blocking all signals.

The biggest downside of the feature that I see is that memory
corruption that affects the registered fast sigblock location, would
cause quite strange application misbehavior. For instance, the process
would be immune to ^C (but killable by SIGKILL).

With consumers (rtld and libthr added), benchmarks do not show a
slow-down of the syscalls in micro-measurements, and macro benchmarks
like buildworld do not demonstrate a difference. Part of the reason is
that buildworld time is dominated by compiler, and clang already links
to libthr. On the other hand, small utilities typically used by shell
scripts have the total number of syscalls cut by half.

The syscall is not exported from the stable libc version namespace on
purpose.  It is intended to be used only by our C runtime
implementation internals.

Tested by:	pho
Disscussed with:	cem, emaste, jilles
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D12773
2020-02-09 11:53:12 +00:00
..
cloudabi Add sys/systm.h to several places that use vm headers. 2020-02-04 18:56:26 +00:00
cloudabi32 sysent targets: further cleanup and deduplication 2020-01-18 20:37:45 +00:00
cloudabi64 sysent targets: further cleanup and deduplication 2020-01-18 20:37:45 +00:00
freebsd32 Add a way to manage thread signal mask using shared word, instead of syscall. 2020-02-09 11:53:12 +00:00
ia32 Use uintptr_t instead of register_t * for the stack base. 2019-12-03 23:17:54 +00:00
lindebugfs
linprocfs linprocfs: Fix some bugs in the maps file implementation. 2020-01-08 16:57:08 +00:00
linsysfs
linux linux futex_put(): do not touch futex after dropping our reference. 2020-02-07 22:21:44 +00:00
linuxkpi/common fd: remove the seq argument from fget_unlocked 2020-02-03 22:27:55 +00:00
ndis Remove comment that no longer describe reality. 2020-01-22 05:32:23 +00:00
netbsd
x86bios