]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rcu: Flag lockless access to ->gp_flags with ACCESS_ONCE()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 9 Aug 2013 05:26:23 +0000 (22:26 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 23 Sep 2013 16:16:13 +0000 (09:16 -0700)
This commit applies ACCESS_ONCE() to an outside-of-lock access to
->gp_flags.  Although it is hard to imagine any sane compiler messing
this particular case up, the documentation benefits are substantial.
Plus the definition of "sane compiler" grows ever looser.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree.c

index 62b67b78b66116557d3b3d171cc938cc090219eb..6d028fdbf86ce44ada9b1cb378d7f61663065615 100644 (file)
@@ -1481,7 +1481,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
                /* Handle grace-period start. */
                for (;;) {
                        wait_event_interruptible(rsp->gp_wq,
-                                                rsp->gp_flags &
+                                                ACCESS_ONCE(rsp->gp_flags) &
                                                 RCU_GP_FLAG_INIT);
                        if (rcu_gp_init(rsp))
                                break;