Skip to content

Commit 63c564d

Browse files
committed
rcu: Mark ->expmask access in synchronize_rcu_expedited_wait()
This commit adds a READ_ONCE() to an access to the rcu_node structure's ->expmask field to prevent compiler mischief. Detected by KCSAN. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 4d266c2 commit 63c564d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/rcu/tree_exp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ static void synchronize_rcu_expedited_wait(void)
502502
if (synchronize_rcu_expedited_wait_once(1))
503503
return;
504504
rcu_for_each_leaf_node(rnp) {
505-
for_each_leaf_node_cpu_mask(rnp, cpu, rnp->expmask) {
505+
mask = READ_ONCE(rnp->expmask);
506+
for_each_leaf_node_cpu_mask(rnp, cpu, mask) {
506507
rdp = per_cpu_ptr(&rcu_data, cpu);
507508
if (rdp->rcu_forced_tick_exp)
508509
continue;

0 commit comments

Comments
 (0)