Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3480324ybl; Mon, 27 Jan 2020 04:59:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyE6ZBMxpkc3IBaH60JdILRv91eTnBTK0zMGOU5MH6IBVTmpGVFQ7l3D9qfa/JQbsibGbUQ X-Received: by 2002:a05:6830:2099:: with SMTP id y25mr11807845otq.87.1580129945376; Mon, 27 Jan 2020 04:59:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580129945; cv=none; d=google.com; s=arc-20160816; b=JWZ+4hX81swEqNDXERl46lWi8RvOUKTXQAM+JRxHTDF2/LxCM/0Vozo6dr+nKbap76 srTVPbp7L/MzIdmEBHa3X76xBUi7/dQEBf9783Yp/DpQOQO6pAhkzc+2+L8GmYV3J1lb cLsAUWJhzauthK74uIB0+TRferwQrKCFI7b7w0L4P6GUv/uyKFohzDVUKJeRec3Mugyi tfM+U6diDoVljFYfR65I61CTAy+4qD4LNWdoNWgoKW41t2mBtn/uzbalikXAFfA4GLhe QpWCFhE8e/go+FVX1YetrQ0RsiwEy9SsomREdFC4+byL6usvXSmRJ0ZN2+dzAekzaLlR L59w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uM06YjihNY9BUhuPV7um2UfVefpCwyylcQN8uI7DHYQ=; b=E8+JFR+3Wx3Hk8EU6vkgUbD5Bikna/cPfLNIhOnx/9Dm6ct7D4mdvSJYdnvZxf9NxQ J47YfgwYhpCuf9opwZvSVlEler0NScZTcWr9jS8ISqk2SOWnAuBh1SPoLDCgogkp3Khy G0G8MtsuGSVo7vNJUKm9sHBZmvntcZfyVTWfyHfWjgucvPnCQ4EhGlYriQcl6waT57el emwp97M3wTRVildcWTmyCYxjp06GwonxETcvWup7Z+QJMhAALYnc8EJk1U92Yig1ttYT LWrK6Q2WXwZVxNH8bqkJTD0UdE2YpLfp70A+iS65vr+Cmz3sk0RDYymie+4o7PKFt6NS rOgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si5386135oth.312.2020.01.27.04.58.53; Mon, 27 Jan 2020 04:59:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729555AbgA0MYF (ORCPT + 99 others); Mon, 27 Jan 2020 07:24:05 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:53253 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgA0MYF (ORCPT ); Mon, 27 Jan 2020 07:24:05 -0500 Received: from ip5f5bd665.dynamic.kabel-deutschland.de ([95.91.214.101] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iw3Qj-0006cW-Ss; Mon, 27 Jan 2020 12:23:50 +0000 Date: Mon, 27 Jan 2020 13:23:48 +0100 From: Christian Brauner To: Oleg Nesterov Cc: madhuparnabhowmik10@gmail.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, ebiederm@xmission.com, paulmck@kernel.org, joel@joelfernandes.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, frextrite@gmail.com, rcu@vger.kernel.org Subject: Re: [PATCH] sched.h: Annotate sighand_struct with __rcu Message-ID: <20200127122348.wzxwuwvhl5uk2lh5@wittgenstein> References: <20200124045908.26389-1-madhuparnabhowmik10@gmail.com> <20200127092951.GA1116@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200127092951.GA1116@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 10:29:52AM +0100, Oleg Nesterov wrote: > On 01/24, madhuparnabhowmik10@gmail.com wrote: > > > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -918,7 +918,7 @@ struct task_struct { > > > > /* Signal handlers: */ > > struct signal_struct *signal; > > - struct sighand_struct *sighand; > > + struct sighand_struct __rcu *sighand; > > sigset_t blocked; > > sigset_t real_blocked; > > /* Restored if set_restore_sigmask() was used: */ > > diff --git a/kernel/signal.c b/kernel/signal.c > > index bcd46f547db3..9ad8dea93dbb 100644 > > --- a/kernel/signal.c > > +++ b/kernel/signal.c > > @@ -1383,7 +1383,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, > > * must see ->sighand == NULL. > > */ > > spin_lock_irqsave(&sighand->siglock, *flags); > > - if (likely(sighand == tsk->sighand)) > > + if (likely(sighand == rcu_access_pointer(tsk->sighand))) > > break; > > spin_unlock_irqrestore(&sighand->siglock, *flags); > > } > > ACK, Applied. Thanks Paul and Oleg! Christian