Skip to content

Commit b0c18c8

Browse files
committed
rcu: Add WRITE_ONCE to rcu_node ->exp_seq_rq store
The rcu_node structure's ->exp_seq_rq field is read locklessly, so this commit adds the WRITE_ONCE() to a load 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 <[email protected]>
1 parent 7672d64 commit b0c18c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tree_exp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static bool exp_funnel_lock(unsigned long s)
314314
sync_exp_work_done(s));
315315
return true;
316316
}
317-
rnp->exp_seq_rq = s; /* Followers can wait on us. */
317+
WRITE_ONCE(rnp->exp_seq_rq, s); /* Followers can wait on us. */
318318
spin_unlock(&rnp->exp_lock);
319319
trace_rcu_exp_funnel_lock(rcu_state.name, rnp->level,
320320
rnp->grplo, rnp->grphi, TPS("nxtlvl"));

0 commit comments

Comments
 (0)