Re: [PATCH v2] signals: Avoid unnecessary taking of sighand->siglock

From: Waiman Long
Date: Mon Sep 26 2016 - 17:24:52 EST

On 09/23/2016 03:43 PM, Stas Sergeev wrote:
23.09.2016 19:56, Waiman Long ÐÐÑÐÑ:
When running certain database workload on a high-end system with many
CPUs, it was found that spinlock contention in the sigprocmask syscalls
became a significant portion of the overall CPU cycles as shown below.
Hi, I was recently facing the same problem, and my solution
was to extract swapcontext() from libtask - it has better semantic
and does not do sigprocmask. How much you hack sigprocmask,
it is still faster to just not call it at all.
Alternatively, perhaps the speed-up can be achieved if the
current mask is exported to glibc via vdso.
Just my 2 cents.

The problem was in a third-party software not under our control. I am just doing my part to try to alleviate the problem from the kernel's perspective.