All of lore.kernel.org
 help / color / mirror / Atom feed
* [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq
@ 2019-06-27 21:01 ` c0d1n61at3
  0 siblings, 0 replies; 21+ messages in thread
From: Jiunn Chang @ 2019-06-27 21:01 UTC (permalink / raw)
  To: skhan
  Cc: linux-kernel-mentees, paulmck, josh, rostedt, mathieu.desnoyers,
	jiangshanlai, joel, corbet, rcu, linux-doc, linux-kernel

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 <paulmck@linux.ibm.com>
Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-06-28 15:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-27 21:01 [Linux-kernel-mentees][PATCH] doc: RCU callback locks need only _bh, not necessarily _irq Jiunn Chang
2019-06-27 21:01 ` [Linux-kernel-mentees] [PATCH] " Jiunn Chang
2019-06-27 21:01 ` c0d1n61at3
2019-06-27 22:01 ` [Linux-kernel-mentees][PATCH] " Shuah Khan
2019-06-27 22:01   ` [Linux-kernel-mentees] [PATCH] " Shuah Khan
2019-06-27 22:01   ` skhan
2019-06-27 22:10   ` [Linux-kernel-mentees][PATCH] " Paul E. McKenney
2019-06-27 22:10     ` [Linux-kernel-mentees] [PATCH] " Paul E. McKenney
2019-06-27 22:10     ` paulmck
2019-06-27 22:11     ` [Linux-kernel-mentees][PATCH] " Shuah Khan
2019-06-27 22:11       ` [Linux-kernel-mentees] [PATCH] " Shuah Khan
2019-06-27 22:11       ` skhan
2019-06-27 22:29     ` [Linux-kernel-mentees][PATCH] " Steven Rostedt
2019-06-27 22:29       ` [Linux-kernel-mentees] [PATCH] " Steven Rostedt
2019-06-27 22:29       ` rostedt
2019-06-27 22:42       ` [Linux-kernel-mentees][PATCH] " Paul E. McKenney
2019-06-27 22:42         ` [Linux-kernel-mentees] [PATCH] " Paul E. McKenney
2019-06-27 22:42         ` paulmck
2019-06-28 15:11 ` [Linux-kernel-mentees][PATCH] " Jonathan Corbet
2019-06-28 15:11   ` [Linux-kernel-mentees] [PATCH] " Jonathan Corbet
2019-06-28 15:11   ` corbet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.