From: Paul E. McKenney Date: Fri, 9 Aug 2013 05:26:23 +0000 (-0700) Subject: rcu: Flag lockless access to ->gp_flags with ACCESS_ONCE() X-Git-Tag: upstream/snapshot3+hdmi~4041^2^2~2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=591c6d1710cd73824057d08eda302cf2a7cfd18a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git rcu: Flag lockless access to ->gp_flags with ACCESS_ONCE() 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 --- diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 62b67b7..6d028fd 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -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;