From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966604AbcIZQ2h (ORCPT ); Mon, 26 Sep 2016 12:28:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38734 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965962AbcIZQ2f (ORCPT ); Mon, 26 Sep 2016 12:28:35 -0400 Date: Mon, 26 Sep 2016 18:28:31 +0200 From: Oleg Nesterov To: Waiman Long Cc: Andrew Morton , Ingo Molnar , Thomas Gleixner , Stas Sergeev , linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH v2] signals: Avoid unnecessary taking of sighand->siglock Message-ID: <20160926162831.GB6782@redhat.com> References: <1474649774-48834-1-git-send-email-Waiman.Long@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474649774-48834-1-git-send-email-Waiman.Long@hpe.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 26 Sep 2016 16:28:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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[0]) == newset->sig[0])) > + 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. Oleg.