signal: retarget_shared_pending: optimize while_each_thread() loop
retarget_shared_pending() blindly does recalc_sigpending_and_wake() for every sub-thread, this is suboptimal. We can check t->blocked and stop looping once every bit in shared_pending has the new target. Note: we do not take task_is_stopped_or_traced(t) into account, we are not trying to speed up the signal delivery or to avoid the unnecessary (but harmless) signal_wake_up(0) in this unlikely case. Signed-off-by: NOleg Nesterov <oleg@redhat.com> Reviewed-by: NMatt Fleming <matt.fleming@linux.intel.com> Acked-by: NTejun Heo <tj@kernel.org>
Showing
想要评论请 注册 或 登录