diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-02-22 20:04:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-25 04:34:53 -0500 |
commit | c598a070bc581aea8a518b460dae8c0cf8e74344 (patch) | |
tree | a74f0323a7432ff836901ca301ca11870d73f940 /Documentation/RCU/checklist.txt | |
parent | e7b0a61b7929632d36cf052d9e2820ef0a9c1bfe (diff) |
rcu: Documentation update for CONFIG_PROVE_RCU
Adds a lockdep.txt file and updates checklist.txt and
whatisRCU.txt to reflect the new lockdep-enabled capabilities of
RCU.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: josh@joshtriplett.org
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: dhowells@redhat.com
LKML-Reference: <1266887105-1528-13-git-send-email-paulmck@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/RCU/checklist.txt')
-rw-r--r-- | Documentation/RCU/checklist.txt | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 767cf06a4276..cbc180f90194 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt | |||
@@ -127,10 +127,14 @@ over a rather long period of time, but improvements are always welcome! | |||
127 | perfectly legal (if redundant) for update-side code to | 127 | perfectly legal (if redundant) for update-side code to |
128 | use rcu_dereference() and the "_rcu()" list-traversal | 128 | use rcu_dereference() and the "_rcu()" list-traversal |
129 | primitives. This is particularly useful in code that | 129 | primitives. This is particularly useful in code that |
130 | is common to readers and updaters. However, neither | 130 | is common to readers and updaters. However, lockdep |
131 | rcu_dereference() nor the "_rcu()" list-traversal | 131 | will complain if you access rcu_dereference() outside |
132 | primitives can substitute for a good concurrency design | 132 | of an RCU read-side critical section. See lockdep.txt |
133 | coordinating among multiple updaters. | 133 | to learn what to do about this. |
134 | |||
135 | Of course, neither rcu_dereference() nor the "_rcu()" | ||
136 | list-traversal primitives can substitute for a good | ||
137 | concurrency design coordinating among multiple updaters. | ||
134 | 138 | ||
135 | b. If the list macros are being used, the list_add_tail_rcu() | 139 | b. If the list macros are being used, the list_add_tail_rcu() |
136 | and list_add_rcu() primitives must be used in order | 140 | and list_add_rcu() primitives must be used in order |
@@ -249,7 +253,9 @@ over a rather long period of time, but improvements are always welcome! | |||
249 | must be protected by appropriate update-side locks. RCU | 253 | must be protected by appropriate update-side locks. RCU |
250 | read-side critical sections are delimited by rcu_read_lock() | 254 | read-side critical sections are delimited by rcu_read_lock() |
251 | and rcu_read_unlock(), or by similar primitives such as | 255 | and rcu_read_unlock(), or by similar primitives such as |
252 | rcu_read_lock_bh() and rcu_read_unlock_bh(). | 256 | rcu_read_lock_bh() and rcu_read_unlock_bh(), in which case |
257 | the matching rcu_dereference() primitive must be used in order | ||
258 | to keep lockdep happy, in this case, rcu_dereference_bh(). | ||
253 | 259 | ||
254 | The reason that it is permissible to use RCU list-traversal | 260 | The reason that it is permissible to use RCU list-traversal |
255 | primitives when the update-side lock is held is that doing so | 261 | primitives when the update-side lock is held is that doing so |
@@ -302,15 +308,15 @@ over a rather long period of time, but improvements are always welcome! | |||
302 | not the case, a self-spawning RCU callback would prevent the | 308 | not the case, a self-spawning RCU callback would prevent the |
303 | victim CPU from ever going offline.) | 309 | victim CPU from ever going offline.) |
304 | 310 | ||
305 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), synchronize_srcu(), | 311 | 14. SRCU (srcu_read_lock(), srcu_read_unlock(), srcu_dereference(), |
306 | and synchronize_srcu_expedited()) may only be invoked from | 312 | synchronize_srcu(), and synchronize_srcu_expedited()) may only |
307 | process context. Unlike other forms of RCU, it -is- permissible | 313 | be invoked from process context. Unlike other forms of RCU, it |
308 | to block in an SRCU read-side critical section (demarked by | 314 | -is- permissible to block in an SRCU read-side critical section |
309 | srcu_read_lock() and srcu_read_unlock()), hence the "SRCU": | 315 | (demarked by srcu_read_lock() and srcu_read_unlock()), hence the |
310 | "sleepable RCU". Please note that if you don't need to sleep | 316 | "SRCU": "sleepable RCU". Please note that if you don't need |
311 | in read-side critical sections, you should be using RCU rather | 317 | to sleep in read-side critical sections, you should be using |
312 | than SRCU, because RCU is almost always faster and easier to | 318 | RCU rather than SRCU, because RCU is almost always faster and |
313 | use than is SRCU. | 319 | easier to use than is SRCU. |
314 | 320 | ||
315 | Also unlike other forms of RCU, explicit initialization | 321 | Also unlike other forms of RCU, explicit initialization |
316 | and cleanup is required via init_srcu_struct() and | 322 | and cleanup is required via init_srcu_struct() and |