Skip to content

Commit 102c14d

Browse files
committed
rcutorture: Fix stray access to rcu_fwd_cb_nodelay
The rcu_fwd_cb_nodelay variable suppresses excessively long read-side delays while carrying out an rcutorture forward-progress test. As such, it is accessed both by readers and updaters, and most of the accesses therefore use *_ONCE(). Except for one in rcu_read_delay(), which this commit fixes. This data race was reported by KCSAN. Not appropriate for backporting due to this being rcutorture. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 2024891 commit 102c14d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/rcutorture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ rcu_read_delay(struct torture_random_state *rrsp, struct rt_read_seg *rtrsp)
339339
* period, and we want a long delay occasionally to trigger
340340
* force_quiescent_state. */
341341

342-
if (!rcu_fwd_cb_nodelay &&
342+
if (!READ_ONCE(rcu_fwd_cb_nodelay) &&
343343
!(torture_random(rrsp) % (nrealreaders * 2000 * longdelay_ms))) {
344344
started = cur_ops->get_gp_seq();
345345
ts = rcu_trace_clock_local();

0 commit comments

Comments
 (0)