Re: [PATCH v2] signals: Avoid unnecessary taking of sighand->siglock
From: Oleg Nesterov
Date: Mon Sep 26 2016 - 12:28:40 EST
On 09/23, Waiman Long wrote:
> + /*
> + * In case the signal mask hasn't changed, we won't need to take
> + * the lock. The current blocked mask can be modified by other CPUs.
> + * To be safe, we need to do an atomic read without lock. As a result,
> + * this check will only be done on 64-bit architectures.
> + */
> + if ((_NSIG_WORDS == 1) &&
> + (READ_ONCE(tsk->blocked.sig) == newset->sig))
> + return;
so in case you missed my reply to V1, I still think that the comment is wrong
and you should drop the _NSIG_WORDS check.