On Thu, 16 Mar 2023 at 13:31, Marco Elver elver@google.com wrote:
From: Dmitry Vyukov dvyukov@google.com
POSIX timers using the CLOCK_PROCESS_CPUTIME_ID clock prefer the main thread of a thread group for signal delivery. However, this has a significant downside: it requires waking up a potentially idle thread.
Instead, prefer to deliver signals to the current thread (in the same thread group) if SIGEV_THREAD_ID is not set by the user. This does not change guaranteed semantics, since POSIX process CPU time timers have never guaranteed that signal delivery is to a specific thread (without SIGEV_THREAD_ID set).
The effect is that we no longer wake up potentially idle threads, and the kernel is no longer biased towards delivering the timer signal to any particular thread (which better distributes the timer signals esp. when multiple timers fire concurrently).
Signed-off-by: Dmitry Vyukov dvyukov@google.com Suggested-by: Oleg Nesterov oleg@redhat.com Reviewed-by: Oleg Nesterov oleg@redhat.com Signed-off-by: Marco Elver elver@google.com
Gentle ping...
Thanks, -- Marco