aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-11-03 16:43:24 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-12-11 13:31:41 -0500
commit9ceae0e248fb553c702d51d5275167d462f4efd2 (patch)
treef7ac3ac7d70cea2bf1db11b4065a357d9dca9d30 /Documentation
parent0c53dd8b31404c1d7fd15be8f065ebaec615a562 (diff)
rcu: Add documentation for raw SRCU read-side primitives
Update various files in Documentation/RCU to reflect srcu_read_lock_raw() and srcu_read_unlock_raw(). Credit to Peter Zijlstra for suggesting use of the existing _raw suffix instead of the earlier bulkref names. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/RCU/checklist.txt6
-rw-r--r--Documentation/RCU/rcu.txt10
-rw-r--r--Documentation/RCU/stallwarn.txt11
-rw-r--r--Documentation/RCU/whatisRCU.txt18
4 files changed, 29 insertions, 16 deletions
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 0c134f8afc6f..bff2d8be1e18 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -328,6 +328,12 @@ over a rather long period of time, but improvements are always welcome!
328 RCU rather than SRCU, because RCU is almost always faster and 328 RCU rather than SRCU, because RCU is almost always faster and
329 easier to use than is SRCU. 329 easier to use than is SRCU.
330 330
331 If you need to enter your read-side critical section in a
332 hardirq or exception handler, and then exit that same read-side
333 critical section in the task that was interrupted, then you need
334 to srcu_read_lock_raw() and srcu_read_unlock_raw(), which avoid
335 the lockdep checking that would otherwise this practice illegal.
336
331 Also unlike other forms of RCU, explicit initialization 337 Also unlike other forms of RCU, explicit initialization
332 and cleanup is required via init_srcu_struct() and 338 and cleanup is required via init_srcu_struct() and
333 cleanup_srcu_struct(). These are passed a "struct srcu_struct" 339 cleanup_srcu_struct(). These are passed a "struct srcu_struct"
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt
index 31852705b586..bf778332a28f 100644
--- a/Documentation/RCU/rcu.txt
+++ b/Documentation/RCU/rcu.txt
@@ -38,11 +38,11 @@ o How can the updater tell when a grace period has completed
38 38
39 Preemptible variants of RCU (CONFIG_TREE_PREEMPT_RCU) get the 39 Preemptible variants of RCU (CONFIG_TREE_PREEMPT_RCU) get the
40 same effect, but require that the readers manipulate CPU-local 40 same effect, but require that the readers manipulate CPU-local
41 counters. These counters allow limited types of blocking 41 counters. These counters allow limited types of blocking within
42 within RCU read-side critical sections. SRCU also uses 42 RCU read-side critical sections. SRCU also uses CPU-local
43 CPU-local counters, and permits general blocking within 43 counters, and permits general blocking within RCU read-side
44 RCU read-side critical sections. These two variants of 44 critical sections. These variants of RCU detect grace periods
45 RCU detect grace periods by sampling these counters. 45 by sampling these counters.
46 46
47o If I am running on a uniprocessor kernel, which can only do one 47o If I am running on a uniprocessor kernel, which can only do one
48 thing at a time, why should I wait for a grace period? 48 thing at a time, why should I wait for a grace period?
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt
index f3e0625f4290..083d88cbc089 100644
--- a/Documentation/RCU/stallwarn.txt
+++ b/Documentation/RCU/stallwarn.txt
@@ -114,12 +114,11 @@ o A hardware failure. This is quite unlikely, but has occurred
114 This resulted in a series of RCU CPU stall warnings, eventually 114 This resulted in a series of RCU CPU stall warnings, eventually
115 leading the realization that the CPU had failed. 115 leading the realization that the CPU had failed.
116 116
117The RCU, RCU-sched, and RCU-bh implementations have CPU stall 117The RCU, RCU-sched, and RCU-bh implementations have CPU stall warning.
118warning. SRCU does not have its own CPU stall warnings, but its 118SRCU does not have its own CPU stall warnings, but its calls to
119calls to synchronize_sched() will result in RCU-sched detecting 119synchronize_sched() will result in RCU-sched detecting RCU-sched-related
120RCU-sched-related CPU stalls. Please note that RCU only detects 120CPU stalls. Please note that RCU only detects CPU stalls when there is
121CPU stalls when there is a grace period in progress. No grace period, 121a grace period in progress. No grace period, no CPU stall warnings.
122no CPU stall warnings.
123 122
124To diagnose the cause of the stall, inspect the stack traces. 123To diagnose the cause of the stall, inspect the stack traces.
125The offending function will usually be near the top of the stack. 124The offending function will usually be near the top of the stack.
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index 6ef692667e2f..8e8cdc2430b9 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -834,6 +834,8 @@ SRCU: Critical sections Grace period Barrier
834 834
835 srcu_read_lock synchronize_srcu N/A 835 srcu_read_lock synchronize_srcu N/A
836 srcu_read_unlock synchronize_srcu_expedited 836 srcu_read_unlock synchronize_srcu_expedited
837 srcu_read_lock_raw
838 srcu_read_unlock_raw
837 srcu_dereference 839 srcu_dereference
838 840
839SRCU: Initialization/cleanup 841SRCU: Initialization/cleanup
@@ -855,27 +857,33 @@ list can be helpful:
855 857
856a. Will readers need to block? If so, you need SRCU. 858a. Will readers need to block? If so, you need SRCU.
857 859
858b. What about the -rt patchset? If readers would need to block 860b. Is it necessary to start a read-side critical section in a
861 hardirq handler or exception handler, and then to complete
862 this read-side critical section in the task that was
863 interrupted? If so, you need SRCU's srcu_read_lock_raw() and
864 srcu_read_unlock_raw() primitives.
865
866c. What about the -rt patchset? If readers would need to block
859 in an non-rt kernel, you need SRCU. If readers would block 867 in an non-rt kernel, you need SRCU. If readers would block
860 in a -rt kernel, but not in a non-rt kernel, SRCU is not 868 in a -rt kernel, but not in a non-rt kernel, SRCU is not
861 necessary. 869 necessary.
862 870
863c. Do you need to treat NMI handlers, hardirq handlers, 871d. Do you need to treat NMI handlers, hardirq handlers,
864 and code segments with preemption disabled (whether 872 and code segments with preemption disabled (whether
865 via preempt_disable(), local_irq_save(), local_bh_disable(), 873 via preempt_disable(), local_irq_save(), local_bh_disable(),
866 or some other mechanism) as if they were explicit RCU readers? 874 or some other mechanism) as if they were explicit RCU readers?
867 If so, you need RCU-sched. 875 If so, you need RCU-sched.
868 876
869d. Do you need RCU grace periods to complete even in the face 877e. Do you need RCU grace periods to complete even in the face
870 of softirq monopolization of one or more of the CPUs? For 878 of softirq monopolization of one or more of the CPUs? For
871 example, is your code subject to network-based denial-of-service 879 example, is your code subject to network-based denial-of-service
872 attacks? If so, you need RCU-bh. 880 attacks? If so, you need RCU-bh.
873 881
874e. Is your workload too update-intensive for normal use of 882f. Is your workload too update-intensive for normal use of
875 RCU, but inappropriate for other synchronization mechanisms? 883 RCU, but inappropriate for other synchronization mechanisms?
876 If so, consider SLAB_DESTROY_BY_RCU. But please be careful! 884 If so, consider SLAB_DESTROY_BY_RCU. But please be careful!
877 885
878f. Otherwise, use RCU. 886g. Otherwise, use RCU.
879 887
880Of course, this all assumes that you have determined that RCU is in fact 888Of course, this all assumes that you have determined that RCU is in fact
881the right tool for your job. 889the right tool for your job.