]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
doc: Update rcu_assign_pointer() definition in whatisRCU.txt
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 7 Mar 2017 15:30:58 +0000 (07:30 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 12 Apr 2017 15:23:42 +0000 (08:23 -0700)
The rcu_assign_pointer() macro has changed over time, and the version
in Documentation/RCU/whatisRCU.txt has not kept up.  This commit brings
it into 2017, albeit in a simplified fashion.

Reported-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Documentation/RCU/whatisRCU.txt

index 5cbd8b2395b811489c68acb7da4616b4a1ef9523..6b0337008f9c7b535e2daca1d31b5d853f433784 100644 (file)
@@ -587,20 +587,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!]
-
-       #define rcu_assign_pointer(p, v)        ({ \
-                                                       smp_wmb(); \
-                                                       (p) = (v); \
-                                               })
-
-       #define rcu_dereference(p)     ({ \
-                                       typeof(p) _________p1 = p; \
-                                       smp_read_barrier_depends(); \
-                                       (_________p1); \
-                                       })
+[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_store_release(&(p), (v)); \
+       })
+
+       #define rcu_dereference(p) \
+       ({ \
+               typeof(p) _________p1 = p; \
+               smp_read_barrier_depends(); \
+               (_________p1); \
+       })
 
 
 The rcu_read_lock() and rcu_read_unlock() primitive read-acquire