Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2572719ybd; Thu, 27 Jun 2019 15:02:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkKBu3u3exFPOoCrO4nYnHw4W4H4Bc0Rng0DfFmD4a30dgz2Rr+hp8TKe6Stwf9qJPYAAb X-Received: by 2002:a65:41c5:: with SMTP id b5mr6093660pgq.128.1561672944117; Thu, 27 Jun 2019 15:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561672944; cv=none; d=google.com; s=arc-20160816; b=u1UFVcxJa9ZV6cUJabfPxprSgm/I/h8zYHG67Fsi9G1yvvequyGVKbx1N9afXNpiWA IMygCUpxqRQikzylxg70qXtWLDXROgkyz9lwPCxscfWgIveyeSq2FLwX5ZgspsfcbEXj HbudTn991CLUZ4b91yVcXZ3pD334w0Ru/h0vjlpciaV/K0BAQV/5fdQCepQBauIej/cv ZblE9GvPGMTrJ0LzzucC5YTjBK8kPsnwT7RuDY+rIP7oP0g+oCICE12PQag9Zdz/IFUP oCf8YIpU0nY6Vzxqxr5qshdOzkCl7/rRiSpBbWOePq7/3HbfdDBSqz/OsuBJllFbm2NP Hfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Wdf1nBH0PL7WyynZAhKLoekJmYEyf1wAOf9OL+xS3ps=; b=mAdjNuTgshLfYoPbr8BKdDOY4veacZpXEVBsqbSm8yfEBJzloQX1uMKaGra23KGluM 4nb6l0oF5kaQl5ZvzGoiKauJbposvV5vbhCi1hhIv3Ow5cZrxPfl3G0K1aCiJ/gWirYW OpS5o1Aq/lyv1rM+v+vabotRqBh89DeYJtp6GmzI5s7xr2SgSeOEex7Mi5ug1O7R1igc caZx6Cewk+sgo8ek6malVxjdJcpHXGakq5eu41v2WtV2I5pvbOgDBGGh360Z6IrxGun4 Rpsvsy+Fy/B3h7tUE9cV3Nj2aUAxenLZwkU6itubgEMrZnV/ZuTLLKt8SA1DxJDhaEDT ZHrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=EZHy57R2; 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 f89si227187pje.50.2019.06.27.15.02.07; Thu, 27 Jun 2019 15:02:24 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=EZHy57R2; 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 S1726716AbfF0WBi (ORCPT + 99 others); Thu, 27 Jun 2019 18:01:38 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:37177 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726553AbfF0WBi (ORCPT ); Thu, 27 Jun 2019 18:01:38 -0400 Received: by mail-io1-f67.google.com with SMTP id e5so8188641iok.4 for ; Thu, 27 Jun 2019 15:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Wdf1nBH0PL7WyynZAhKLoekJmYEyf1wAOf9OL+xS3ps=; b=EZHy57R286JnmS4RonvV6TgNEpBo7e4UR6VUQq5Li7wTrWYpHwlkn/4WQUkF2lQ6Id Rv3dpR5L2/bLYYSOZX6qLqoRJ06fSz1sXieusMNnGTlqu43X9nUNHFZCEqWM7ABauNp4 G56OIJb6sANOtjquvzu+W7fjjNna3Qti3oceA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Wdf1nBH0PL7WyynZAhKLoekJmYEyf1wAOf9OL+xS3ps=; b=Y/JKeO+FUB9sdDPYb2Kj/jtbxNf7nJNz2kXSUenw/L+Il4Fz9omvxub+/QB/8gA1+W huyvKE+lO0+V02lDFNOTLB+cMbFljU9hhwncuZNCmJGHjRC4XgUmhrYwlAJKnTpPVxe4 ozzEc7ar7fGyKlXuq3uydBOViXpLN0qj7jHTa5S6pJvAd/wZ+nupRUCiAQHSP+RNVaJ6 nd8M3qzIfgohdntrVXkCRkFB2g7hchhYzB7gBwIFLcAJgiSPQ0Oz7oCaY3hSzs3V5i// YxTj/dBeBar+/+EyCW6Yng1IXiOTltxYHv9LvVYLURnHMOIDz9YT9G202xUFq6u72phE LLAQ== X-Gm-Message-State: APjAAAVlIbV6aT/afu0hFEOCGXdyhwzCHLCcto4Y2RQ52y335KfOr7v+ meqzY5v8E4MkeR7Jg/rY4VZzrQ== X-Received: by 2002:a6b:7606:: with SMTP id g6mr7245403iom.288.1561672897612; Thu, 27 Jun 2019 15:01:37 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id p25sm319707iol.48.2019.06.27.15.01.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 15:01:36 -0700 (PDT) Subject: Re: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq To: Jiunn Chang Cc: linux-kernel-mentees@lists.linuxfoundation.org, paulmck@linux.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, corbet@lwn.net, rcu@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "skh >> Shuah Khan" References: <20190627210147.19510-1-c0d1n61at3@gmail.com> From: Shuah Khan Message-ID: Date: Thu, 27 Jun 2019 16:01:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190627210147.19510-1-c0d1n61at3@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/27/19 3:01 PM, Jiunn Chang wrote: > The UP.rst file calls for locks acquired within RCU callback functions > to use _irq variants (spin_lock_irqsave() or similar), which does work, > but can be overkill. This commit therefore instead calls for _bh variants > (spin_lock_bh() or similar), while noting that _irq does work. > > Signed-off-by: Paul E. McKenney Should this by Suggested-by? > Signed-off-by: Jiunn Chang > --- > Documentation/RCU/UP.rst | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/Documentation/RCU/UP.rst b/Documentation/RCU/UP.rst > index 67715a47ae89..e26dda27430c 100644 > --- a/Documentation/RCU/UP.rst > +++ b/Documentation/RCU/UP.rst > @@ -113,12 +113,13 @@ Answer to Quick Quiz #1: > Answer to Quick Quiz #2: > What locking restriction must RCU callbacks respect? > > - Any lock that is acquired within an RCU callback must be > - acquired elsewhere using an _irq variant of the spinlock > - primitive. For example, if "mylock" is acquired by an > - RCU callback, then a process-context acquisition of this > - lock must use something like spin_lock_irqsave() to > - acquire the lock. > + Any lock that is acquired within an RCU callback must be acquired > + elsewhere using an _bh variant of the spinlock primitive. > + For example, if "mylock" is acquired by an RCU callback, then > + a process-context acquisition of this lock must use something > + like spin_lock_bh() to acquire the lock. Please note that > + it is also OK to use _irq variants of spinlocks, for example, > + spin_lock_irqsave(). > > If the process-context code were to simply use spin_lock(), > then, since RCU callbacks can be invoked from softirq context, > thanks, -- Shuah