diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 46d97055c2fc..9c7b293d1caf 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -469,12 +469,14 @@ rcu_read_delay(struct torture_random_state *rrsp, struct rt_read_seg *rtrsp) unsigned long longdelay_ms = 300; unsigned long long ts; - /* We want a short delay sometimes to make a reader delay the grace - * period, and we want a long delay occasionally to trigger - * force_quiescent_state. */ + // If there is a forward-progress test in flight, don't delay. + if (atomic_read(&rcu_fwd_cb_nodelay)) + return; - if (!atomic_read(&rcu_fwd_cb_nodelay) && - !(torture_random(rrsp) % (nrealreaders * 2000 * longdelay_ms))) { + // We want a short delay sometimes to make a reader delay the grace + // period, and we want a long delay occasionally to trigger + // force_quiescent_state. + if (!(torture_random(rrsp) % (nrealreaders * 2000 * longdelay_ms))) { started = cur_ops->get_gp_seq(); ts = rcu_trace_clock_local(); if ((preempt_count() & HARDIRQ_MASK) || softirq_count()) @@ -766,6 +768,10 @@ srcu_read_delay(struct torture_random_state *rrsp, struct rt_read_seg *rtrsp) const long uspertick = 1000000 / HZ; const long longdelay = 10; + // If there is a forward-progress test in flight, don't delay. + if (atomic_read(&rcu_fwd_cb_nodelay)) + return; + // We want there to be long-running readers, but not all the time. // The !rcu_preempt_depth() is for RCU Tasks Trace.