Skip to content

Commit 3cf5016

Browse files
paulmckrcufbq
authored andcommitted
doc: Make checklist.rst note that spinlocks are implied RCU readers
In kernels built with CONFIG_PREEMPT_RT=n, spinlock critical sections are RCU readers because they disable preemption. However, they are also RCU readers in CONFIG_PREEMPT_RT=y because in that case the locking primitives contain rcu_read_lock() and rcu_read_unlock(). Therefore, upgrade checklist.rst to document this non-obvious case. While in the area, fix a typo by changing "read-side critical" to "read-side critical section". Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 8dbc33b commit 3cf5016

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Documentation/RCU/checklist.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ over a rather long period of time, but improvements are always welcome!
6868
rcu_read_lock_sched(), or by the appropriate update-side lock.
6969
Explicit disabling of preemption (preempt_disable(), for example)
7070
can serve as rcu_read_lock_sched(), but is less readable and
71-
prevents lockdep from detecting locking issues.
71+
prevents lockdep from detecting locking issues. Acquiring a
72+
spinlock also enters an RCU read-side critical section.
7273

7374
Please note that you *cannot* rely on code known to be built
7475
only in non-preemptible kernels. Such code can and will break,
@@ -444,7 +445,7 @@ over a rather long period of time, but improvements are always welcome!
444445
real-time workloads than is synchronize_rcu_expedited().
445446

446447
It is also permissible to sleep in RCU Tasks Trace read-side
447-
critical, which are delimited by rcu_read_lock_trace() and
448+
critical section, which are delimited by rcu_read_lock_trace() and
448449
rcu_read_unlock_trace(). However, this is a specialized flavor
449450
of RCU, and you should not use it without first checking with
450451
its current users. In most cases, you should instead use SRCU.

0 commit comments

Comments
 (0)