Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2524971ybd; Thu, 27 Jun 2019 14:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEfvNcjNT/EigJRyvWVJOUhZDZhZ1Ee7egj+sFny5IHK6WtK7zgZC9KHBrDM5imOoNwZhL X-Received: by 2002:a17:902:d717:: with SMTP id w23mr6512750ply.275.1561669338524; Thu, 27 Jun 2019 14:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561669338; cv=none; d=google.com; s=arc-20160816; b=PuCVJBf/pKOHxfKosvJWJmyy1CX+qyLlQg2822JHWqmcS1fPqTwwtdix/U+1jLGqg6 VdiSmlc0j6wAKXIxJjNaj9pS6gIAMD7HfajFG9e1NE20+yHfyJvI11nOado5uheuROFz woGURZYQ44wMKAsNo6SvMPLKvH/wjyPmYwYYiRezhj/8UPYSHa6d5MamwyGmiHfna067 HUj1cmQHPWea4QNhtfPRS3q2wSSznKk5zq6e/pZMTFzpm58NSxA/V5I8X543XnRTcI+W e8B2NddIGCn9xxEjlCi7Mwy5b5IVZPjI0I46hEFdGLvFDbhgigP1nNH4Uhak0LmwCM40 5H6A== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=46fsmRV54TI9u4qvwSxfKVE3AHZxURoD917dwtDUxuM=; b=wzUgPSdgsWbl/A7v0ZRmwz9IipK6sb4xObOeDBojeaEiwA4ACFs8yctID2ekkqztvX wd9uvB7BiXY2rF1vfiVE09tIflxnK2j0FPwl5lA7bwsCmYO1u0EOcBdTnXS4OwhC7hdJ VPcPIEU+TJmjWjTQ4FKHEUNakr5VxZcl1jNv3ubYaFhDs7mNmV0MfKXGtzUbRFZ1oMUY wuiMFXuhx46DVBoik3lMXNPDjRfn8CVBmqThrdlbMHdms4NUu/YN71bc/vAidXFvHGvm t3kmgl1g0waOKFInFmEFO5ZnA2SSewYNY0PZXiDNhOkFCp9ycULeZiC2Ik4qo08dHdWk 56Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lvwP3K3i; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si87108pfd.226.2019.06.27.14.02.02; Thu, 27 Jun 2019 14:02:18 -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=@gmail.com header.s=20161025 header.b=lvwP3K3i; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726506AbfF0VBv (ORCPT + 99 others); Thu, 27 Jun 2019 17:01:51 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:43258 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfF0VBu (ORCPT ); Thu, 27 Jun 2019 17:01:50 -0400 Received: by mail-ot1-f68.google.com with SMTP id i8so3726836oth.10; Thu, 27 Jun 2019 14:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=46fsmRV54TI9u4qvwSxfKVE3AHZxURoD917dwtDUxuM=; b=lvwP3K3iw+5FF+C4mYw4gFEeOjHmRThblBmhHO/VELWQQvqCGTfD4rQdLwv8dKEVdg W6LXzT2aqC8tsrx9Yyd4mV824j3zik4+R7plhAeYd6EICVKCk5cBUeZKPfg6xgOE98kp hMohMvZhSwq0M4kQiEpyN/RQyj9G9v4cFQi5WsGJJIjU/HnZT6iE+xbYRzh0RqL/g/wp D4Bh/+wMh4UsN69yc/2aKoJg58TNTm0K9IlDJTzOXSIPP1lm1q3c74pJNbJuwLEjoj4m VmEFxspsTO41zNkZk43bQvFnH0iVJvZWliz435qG3frj/MnZs394VaV9miBP3YMV2uuB TJKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=46fsmRV54TI9u4qvwSxfKVE3AHZxURoD917dwtDUxuM=; b=OfM/ncHbpI0KK+lDOgej+xsW63796uad8ywkRS+Xecjm4bTnqG3XkWvpCeg2mHU45s z8sUr00r04VVJJ1IoybesWXTVwL5MPry9gq+h1vW4faBS7yPraShNhrCaSGR9hhhj9+r K5hCDLB7uavyxO+c8OH6ihyUplUEhZ9zING3EqaGHAHVQaMJ4wwdyKV77kfErUhEke/a UQEO0iOom75wCJt0+IKbs1Ane5Cmyh15GWhHJkapA32xtAibFEeAXhGjWWTIAX0FOQDd AH5oMK0Q7xSSjdrWZFLFZ51V88+XA0gBn6dAeFRRmiokghPaR+WUGsPaOZDy475jk0eo x2zg== X-Gm-Message-State: APjAAAXJdJCSBssg1HtFJu+woS2ekueHgnnv9CpBnB6sKHlbo69Fr5ea jYjArxixtiJb55iOED5NvnM= X-Received: by 2002:a9d:6a92:: with SMTP id l18mr5033616otq.294.1561669309835; Thu, 27 Jun 2019 14:01:49 -0700 (PDT) Received: from rYz3n.attlocal.net ([2600:1700:210:3790::48]) by smtp.googlemail.com with ESMTPSA id c64sm86066otb.79.2019.06.27.14.01.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 14:01:49 -0700 (PDT) From: Jiunn Chang To: skhan@linuxfoundation.org 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 Subject: [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq Date: Thu, 27 Jun 2019 16:01:47 -0500 Message-Id: <20190627210147.19510-1-c0d1n61at3@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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, -- 2.22.0