Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic...
[safe/jmp/linux-2.6] / Documentation / RCU / checklist.txt
index 767cf06..790d1a8 100644 (file)
@@ -127,10 +127,14 @@ over a rather long period of time, but improvements are always welcome!
                perfectly legal (if redundant) for update-side code to
                use rcu_dereference() and the "_rcu()" list-traversal
                primitives.  This is particularly useful in code that
-               is common to readers and updaters.  However, neither
-               rcu_dereference() nor the "_rcu()" list-traversal
-               primitives can substitute for a good concurrency design
-               coordinating among multiple updaters.
+               is common to readers and updaters.  However, lockdep
+               will complain if you access rcu_dereference() outside
+               of an RCU read-side critical section.  See lockdep.txt
+               to learn what to do about this.
+
+               Of course, neither rcu_dereference() nor the "_rcu()"
+               list-traversal primitives can substitute for a good
+               concurrency design coordinating among multiple updaters.
 
        b.      If the list macros are being used, the list_add_tail_rcu()
                and list_add_rcu() primitives must be used in order
@@ -249,12 +253,15 @@ over a rather long period of time, but improvements are always welcome!
        must be protected by appropriate update-side locks.  RCU
        read-side critical sections are delimited by rcu_read_lock()
        and rcu_read_unlock(), or by similar primitives such as
-       rcu_read_lock_bh() and rcu_read_unlock_bh().
+       rcu_read_lock_bh() and rcu_read_unlock_bh(), in which case
+       the matching rcu_dereference() primitive must be used in order
+       to keep lockdep happy, in this case, rcu_dereference_bh().
 
        The reason that it is permissible to use RCU list-traversal
        primitives when the update-side lock is held is that doing so
        can be quite helpful in reducing code bloat when common code is
-       shared between readers and updaters.
+       shared between readers and updaters.  Additional primitives
+       are provided for this case, as discussed in lockdep.txt.
 
 10.    Conversely, if you are in an RCU read-side critical section,
        and you don't hold the appropriate update-side lock, you -must-
@@ -302,15 +309,15 @@ over a rather long period of time, but improvements are always welcome!
        not the case, a self-spawning RCU callback would prevent the
        victim CPU from ever going offline.)
 
-14.    SRCU (srcu_read_lock(), srcu_read_unlock(), synchronize_srcu(),
-       and synchronize_srcu_expedited()) may only be invoked from
-       process context.  Unlike other forms of RCU, it -is- permissible
-       to block in an SRCU read-side critical section (demarked by
-       srcu_read_lock() and srcu_read_unlock()), hence the "SRCU":
-       "sleepable RCU".  Please note that if you don't need to sleep
-       in read-side critical sections, you should be using RCU rather
-       than SRCU, because RCU is almost always faster and easier to
-       use than is SRCU.
+14.    SRCU (srcu_read_lock(), srcu_read_unlock(), srcu_dereference(),
+       synchronize_srcu(), and synchronize_srcu_expedited()) may only
+       be invoked from process context.  Unlike other forms of RCU, it
+       -is- permissible to block in an SRCU read-side critical section
+       (demarked by srcu_read_lock() and srcu_read_unlock()), hence the
+       "SRCU": "sleepable RCU".  Please note that if you don't need
+       to sleep in read-side critical sections, you should be using
+       RCU rather than SRCU, because RCU is almost always faster and
+       easier to use than is SRCU.
 
        Also unlike other forms of RCU, explicit initialization
        and cleanup is required via init_srcu_struct() and
@@ -338,8 +345,8 @@ over a rather long period of time, but improvements are always welcome!
        requiring SRCU's read-side deadlock immunity or low read-side
        realtime latency.
 
-       Note that, rcu_assign_pointer() and rcu_dereference() relate to
-       SRCU just as they do to other forms of RCU.
+       Note that, rcu_assign_pointer() relates to SRCU just as they do
+       to other forms of RCU.
 
 15.    The whole point of call_rcu(), synchronize_rcu(), and friends
        is to wait until all pre-existing readers have finished before