]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rcu: Document RCU_INIT_POINTER()'s lack of ordering guarantees
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 31 Mar 2014 20:13:02 +0000 (13:13 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 29 Apr 2014 15:45:13 +0000 (08:45 -0700)
Although rcu_assign_pointer() provides ordering guarantees,
RCU_INIT_POINTER() does not.  This commit makes that explicit
in the docbook comment header.

Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
include/linux/rcupdate.h

index fdc422f3d61d688ea60a4a56ed9cc2dc3de55909..3c5ef02ea580ef222aba8823e9c0ac83b4fcf4e7 100644 (file)
@@ -949,6 +949,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
  * pointers, but you must use rcu_assign_pointer() to initialize the
  * external-to-structure pointer -after- you have completely initialized
  * the reader-accessible portions of the linked structure.
+ *
+ * Note that unlike rcu_assign_pointer(), RCU_INIT_POINTER() provides no
+ * ordering guarantees for either the CPU or the compiler.
  */
 #define RCU_INIT_POINTER(p, v) \
        do { \