]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - Documentation/RCU/whatisRCU.txt
Merge branches 'doc.2017.04.12a', 'fixes.2017.04.19a' and 'srcu.2017.04.21a' into...
[karo-tx-linux.git] / Documentation / RCU / whatisRCU.txt
index 5cbd8b2395b811489c68acb7da4616b4a1ef9523..8ed6c9f6133c45a54c442d04ed0814dc2dcd1a45 100644 (file)
@@ -562,7 +562,9 @@ This section presents a "toy" RCU implementation that is based on
 familiar locking primitives.  Its overhead makes it a non-starter for
 real-life use, as does its lack of scalability.  It is also unsuitable
 for realtime use, since it allows scheduling latency to "bleed" from
-one read-side critical section to another.
+one read-side critical section to another.  It also assumes recursive
+reader-writer locks:  If you try this with non-recursive locks, and
+you allow nested rcu_read_lock() calls, you can deadlock.
 
 However, it is probably the easiest implementation to relate to, so is
 a good starting point.
@@ -587,20 +589,21 @@ It is extremely simple:
                write_unlock(&rcu_gp_mutex);
        }
 
-[You can ignore rcu_assign_pointer() and rcu_dereference() without
-missing much.  But here they are anyway.  And whatever you do, don't
-forget about them when submitting patches making use of RCU!]
+[You can ignore rcu_assign_pointer() and rcu_dereference() without missing
+much.  But here are simplified versions anyway.  And whatever you do,
+don't forget about them when submitting patches making use of RCU!]
 
-       #define rcu_assign_pointer(p, v)        ({ \
-                                                       smp_wmb(); \
-                                                       (p) = (v); \
-                                               })
+       #define rcu_assign_pointer(p, v) \
+       ({ \
+               smp_store_release(&(p), (v)); \
+       })
 
-       #define rcu_dereference(p)     ({ \
-                                       typeof(p) _________p1 = p; \
-                                       smp_read_barrier_depends(); \
-                                       (_________p1); \
-                                       })
+       #define rcu_dereference(p) \
+       ({ \
+               typeof(p) _________p1 = p; \
+               smp_read_barrier_depends(); \
+               (_________p1); \
+       })
 
 
 The rcu_read_lock() and rcu_read_unlock() primitive read-acquire
@@ -925,7 +928,8 @@ d.  Do you need RCU grace periods to complete even in the face
 
 e.     Is your workload too update-intensive for normal use of
        RCU, but inappropriate for other synchronization mechanisms?
-       If so, consider SLAB_DESTROY_BY_RCU.  But please be careful!
+       If so, consider SLAB_TYPESAFE_BY_RCU (which was originally
+       named SLAB_DESTROY_BY_RCU).  But please be careful!
 
 f.     Do you need read-side critical sections that are respected
        even though they are in the middle of the idle loop, during