Fast sigblock

Konstantin Belousov kostikbel at gmail.com
Mon Jan 13 16:13:31 UTC 2020


https://reviews.freebsd.org/D12773

I intend to commit this in approximately week timeline. The overview
of the feature is provided in the review summary above. Short story
is, userspace can mask all maskable asynchronous signals with a single
memory write, which allows to greatly speed up rtld for single-threaded
processes.  For small utilities like ls(1), the number of syscalls issued
is cut by 1.5-2 times.

I believe that a similar feature existed in Solaris, and I saw a mention
of it added to DragonFlyBSD. This patch sit in my local repo for many
years, I decided to commit it finally.

See the following interesting comparision of the startup and runtime
cost in term of syscalls https://drewdevault.com/2020/01/04/Slow.html
Unpatched we are close to glibc, with the patch applied most of
the syscalls issued are mmap(2)s from rtld private allocator and
jemalloc(3).



More information about the freebsd-arch mailing list