diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2022-07-05 12:15:35 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-08-31 04:58:14 -0700 |
commit | 4d2f862b5b49141a1762baa67c846c598b54be27 (patch) | |
tree | def5afcf9ccf1604a0cebdfad94c2d4663b5af5b /Documentation/RCU | |
parent | 568035b01cfb107af8d2e4bd2fb9aea22cf5b868 (diff) | |
download | lwn-4d2f862b5b49141a1762baa67c846c598b54be27.tar.gz lwn-4d2f862b5b49141a1762baa67c846c598b54be27.zip |
doc: Emphasize the need for explicit RCU read-side markers
This commit updates checklist.rst to emphasize the need for explicit
markers for RCU read-side critical sections.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'Documentation/RCU')
-rw-r--r-- | Documentation/RCU/checklist.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/RCU/checklist.rst b/Documentation/RCU/checklist.rst index 42cc5d891bd2..5eedef027d92 100644 --- a/Documentation/RCU/checklist.rst +++ b/Documentation/RCU/checklist.rst @@ -66,8 +66,13 @@ over a rather long period of time, but improvements are always welcome! As a rough rule of thumb, any dereference of an RCU-protected pointer must be covered by rcu_read_lock(), rcu_read_lock_bh(), rcu_read_lock_sched(), or by the appropriate update-side lock. - Disabling of preemption can serve as rcu_read_lock_sched(), but - is less readable and prevents lockdep from detecting locking issues. + Explicit disabling of preemption (preempt_disable(), for example) + can serve as rcu_read_lock_sched(), but is less readable and + prevents lockdep from detecting locking issues. + + Please not that you *cannot* rely on code known to be built + only in non-preemptible kernels. Such code can and will break, + especially in kernels built with CONFIG_PREEMPT_COUNT=y. Letting RCU-protected pointers "leak" out of an RCU read-side critical section is every bit as bad as letting them leak out |