Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2606552ybd; Thu, 27 Jun 2019 15:44:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqymOt+XVbIgP38Bdx01GNiMv55QXgJPuvlQbM6Kaj0YrZibstK3ASh8mRmAfsmbSGH11Y+O X-Received: by 2002:a17:902:7793:: with SMTP id o19mr7444717pll.110.1561675480692; Thu, 27 Jun 2019 15:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561675480; cv=none; d=google.com; s=arc-20160816; b=pYkT2R4VDACeuwOZf1UqHbGYdLD/t3r6OWdU9l4qTqI0v0aUT73wiH3sLIRx3io87q rk+W6ScB/GmrjMaqJfGK2OXKlChaIZw63pW6BFSVS6iw9af1WPwtN7uaPr07/QZFiN1Z joeHaeSJ7Cabyr737UIsS1b1pP1JrdEwPHv1g6x5Cf/U+8EA1uBMuhMR/JHEMua5cIiY 09bF+v0e7PpxiIwG/TpnThPVNdBiHLzermxJRZYZn2WkjMlTpxtoVyUQNv6Ytx6F/HmO eggKTeQ1TfkSDaZ+YGIpgFGv4+zlNHG3+tzb64jcUPrBtEuzyrhtFyn41UHikb3crFo2 v3eQ== 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:reply-to:message-id :subject:cc:to:from:date; bh=Bhj3hjNYaDz9EKWYge9Tly1VUhC6u4xnOPWitRpbI40=; b=lxU6KyYgkMNCOr7xNAm54rApyHyBCS6+5/GQRVG0TsB4ScWUylyUx5KnaTb7ZSgzcx cN8po0OXOybRICSY3aF1/qBpbhs/oEnWg15japF+apOuxQKbCDGuSqpwjgKE/3WH4iHH +zY1CYHFFQrfWwmirSLuD+54GzMoCXqT/HEJXfXcUAshLBFWVww3z662fRlwoOMoF6Ap SqtqgnuSwx1m+j6hth4DxTut91KQRdNdXsqJ9QybqsMsYobPllO/GYpEDcgPSt9bayir v4awA49I7+ysDi/5SJ+NcwxI59Kpq5K6bS2Fax7ZpbPTCc63aKNlHItbY5Vrv1VQcgiN FJWA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si416585pgu.469.2019.06.27.15.44.23; Thu, 27 Jun 2019 15:44:40 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726691AbfF0WnB (ORCPT + 99 others); Thu, 27 Jun 2019 18:43:01 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:23790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbfF0WnB (ORCPT ); Thu, 27 Jun 2019 18:43:01 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5RMgA3I089488; Thu, 27 Jun 2019 18:42:23 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2td6e30ux4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 18:42:23 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x5RMgN29089882; Thu, 27 Jun 2019 18:42:23 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2td6e30uwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 18:42:23 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x5RMdvid032307; Thu, 27 Jun 2019 22:42:22 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma03dal.us.ibm.com with ESMTP id 2t9by7hcg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jun 2019 22:42:22 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5RMgLUr47579548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jun 2019 22:42:21 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96D3DB2065; Thu, 27 Jun 2019 22:42:21 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69D4CB2064; Thu, 27 Jun 2019 22:42:21 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.26]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 27 Jun 2019 22:42:21 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id B3F5F16C6AC1; Thu, 27 Jun 2019 15:42:23 -0700 (PDT) Date: Thu, 27 Jun 2019 15:42:23 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Shuah Khan , Jiunn Chang , linux-kernel-mentees@lists.linuxfoundation.org, josh@joshtriplett.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 Subject: Re: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq Message-ID: <20190627224223.GJ26519@linux.ibm.com> Reply-To: paulmck@linux.ibm.com References: <20190627210147.19510-1-c0d1n61at3@gmail.com> <20190627221045.GH26519@linux.ibm.com> <20190627182938.306ab9d9@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190627182938.306ab9d9@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-27_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906270262 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 27, 2019 at 06:29:38PM -0400, Steven Rostedt wrote: > On Thu, 27 Jun 2019 15:10:45 -0700 > "Paul E. McKenney" wrote: > > > On Thu, Jun 27, 2019 at 04:01:35PM -0600, Shuah Khan wrote: > > > 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? > > > > I wrote it and Jiunn converted my change to .rst, so I believe that > > this is correct as is. > > Note, you did send Jiunn an explicit Signed-off-by when you wrote it, > correct? As Signed-off-by is equivalent to a signature. Indeed I did, but I now see that it was via private email. Here it is again for public consumption, and Jiunn's patch is based on this one, just translated to .rst. I once again verified that the Jiunn's version is word-for-word identical to mine, so Jiunn's patch should be good. ;-) Thanx, Paul ------------------------------------------------------------------------ commit a293734a310b463a0dba68409943a4e6065cd39d Author: Paul E. McKenney Date: Wed Jun 26 10:16:19 2019 -0700 doc: RCU callback locks need only _bh, not necessarily _irq The UP.txt 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 diff --git a/Documentation/RCU/UP.txt b/Documentation/RCU/UP.txt index 53bde717017b..0edd8c5af0b5 100644 --- a/Documentation/RCU/UP.txt +++ b/Documentation/RCU/UP.txt @@ -104,12 +104,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,