]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Make rcu_assign_pointer() unconditionally insert a memory barrier
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 1 Aug 2011 05:09:25 +0000 (22:09 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 6 Sep 2011 18:27:02 +0000 (11:27 -0700)
commitc98e50b6d33c1683c18c7404d41a55b6e93c09dd
treeae20f64cd6a921ab78c1844f83d8c9c29e07ed62
parent3c84d7f77be9fe970ca08baa18d7ca53413f5a32
rcu: Make rcu_assign_pointer() unconditionally insert a memory barrier

Recent changes to gcc give warning messages on rcu_assign_pointers()'s
checks that allow it to determine when it is OK to omit the memory
barrier.  Stephen Hemminger tried a number of gcc tricks to silence
this warning, but #pragmas and CPP macros do not work together in the
way that would be required to make this work.

However, we now have RCU_INIT_POINTER(), which already omits this
memory barrier, and which therefore may be used when assigning NULL to
an RCU-protected pointer that is accessible to readers.  This commit
therefore makes rcu_assign_pointer() unconditionally emit the memory
barrier.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rcupdate.h