aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree_stall.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-01-07 15:48:39 -0800
committerPaul E. McKenney <paulmck@kernel.org>2020-02-20 15:58:22 -0800
commita5b8950180f8e5acb802d1672e0b4d0ceee6126e (patch)
treefa0f8d7e3bd76c2db2df2c59d818c6b2f8def89c /kernel/rcu/tree_stall.h
parentrcu: Fix typos in file-header comments (diff)
downloadlinux-dev-a5b8950180f8e5acb802d1672e0b4d0ceee6126e.tar.xz
linux-dev-a5b8950180f8e5acb802d1672e0b4d0ceee6126e.zip
rcu: Add READ_ONCE() to rcu_data ->gpwrap
The rcu_data structure's ->gpwrap field is read locklessly, and so this commit adds the required READ_ONCE() to a pair of laods in order to avoid destructive compiler optimizations. This data race was reported by KCSAN. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/tree_stall.h')
-rw-r--r--kernel/rcu/tree_stall.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index 43dc688c3785..bca637b274fb 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -602,7 +602,7 @@ void show_rcu_gp_kthreads(void)
continue;
for_each_leaf_node_possible_cpu(rnp, cpu) {
rdp = per_cpu_ptr(&rcu_data, cpu);
- if (rdp->gpwrap ||
+ if (READ_ONCE(rdp->gpwrap) ||
ULONG_CMP_GE(READ_ONCE(rcu_state.gp_seq),
READ_ONCE(rdp->gp_seq_needed)))
continue;