diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2020-01-20 15:29:04 -0800 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-02-20 15:58:23 -0800 |
commit | 59881bcd85a06565c53fd13ce3b0ad7fa55e560c (patch) | |
tree | 675ba755b0405c7967b28e4235c56eca27a7f699 /kernel/rcu | |
parent | 57721fd15a02f7df9dad1f3cca27f21e03ee118f (diff) | |
download | linux-59881bcd85a06565c53fd13ce3b0ad7fa55e560c.tar.gz linux-59881bcd85a06565c53fd13ce3b0ad7fa55e560c.tar.bz2 linux-59881bcd85a06565c53fd13ce3b0ad7fa55e560c.zip |
rcu: Add WRITE_ONCE() to rcu_state ->gp_start
The rcu_state structure's ->gp_start field is read locklessly, so this
commit adds the WRITE_ONCE() to an update in order to provide proper
documentation and READ_ONCE()/WRITE_ONCE() pairing.
This data race was reported by KCSAN. Not appropriate for backporting
due to failure being unlikely.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree_stall.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index bca637b274fb..488b71d03030 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -102,7 +102,7 @@ static void record_gp_stall_check_time(void) unsigned long j = jiffies; unsigned long j1; - rcu_state.gp_start = j; + WRITE_ONCE(rcu_state.gp_start, j); j1 = rcu_jiffies_till_stall_check(); /* Record ->gp_start before ->jiffies_stall. */ smp_store_release(&rcu_state.jiffies_stall, j + j1); /* ^^^ */ |