Skip to content

Commit fd2a749

Browse files
paulmckrcufbq
authored andcommitted
rcutorture: Suppress rtort_pipe_count warnings until after stalls
Currently, if rcu_torture_writer() sees fewer than ten grace periods having elapsed during a call to stutter_wait() that actually waited, the rtort_pipe_count warning is emitted. This has worked well for a long time. Except that the rcutorture TREE07 scenario now does a short-term 14-second RCU CPU stall, which can most definitely case false-positive rtort_pipe_count warnings. This commit therefore changes rcu_torture_writer() to compute the full expected holdoff and stall duration, and to refuse to report any rtort_pipe_count warnings until after all stalls have completed. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 6705083 commit fd2a749

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

kernel/rcu/rcutorture.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,9 +1368,13 @@ rcu_torture_writer(void *arg)
13681368
struct rcu_torture *rp;
13691369
struct rcu_torture *old_rp;
13701370
static DEFINE_TORTURE_RANDOM(rand);
1371+
unsigned long stallsdone = jiffies;
13711372
bool stutter_waited;
13721373
unsigned long ulo[NUM_ACTIVE_RCU_POLL_OLDSTATE];
13731374

1375+
// If a new stall test is added, this must be adjusted.
1376+
if (stall_cpu_holdoff + stall_gp_kthread + stall_cpu)
1377+
stallsdone += (stall_cpu_holdoff + stall_gp_kthread + stall_cpu + 60) * HZ;
13741378
VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
13751379
if (!can_expedite)
13761380
pr_alert("%s" TORTURE_FLAG
@@ -1576,11 +1580,11 @@ rcu_torture_writer(void *arg)
15761580
!atomic_read(&rcu_fwd_cb_nodelay) &&
15771581
!cur_ops->slow_gps &&
15781582
!torture_must_stop() &&
1579-
boot_ended)
1583+
boot_ended &&
1584+
time_after(jiffies, stallsdone))
15801585
for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++)
15811586
if (list_empty(&rcu_tortures[i].rtort_free) &&
1582-
rcu_access_pointer(rcu_torture_current) !=
1583-
&rcu_tortures[i]) {
1587+
rcu_access_pointer(rcu_torture_current) != &rcu_tortures[i]) {
15841588
tracing_off();
15851589
show_rcu_gp_kthreads();
15861590
WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count);
@@ -2441,7 +2445,8 @@ static struct notifier_block rcu_torture_stall_block = {
24412445

24422446
/*
24432447
* CPU-stall kthread. It waits as specified by stall_cpu_holdoff, then
2444-
* induces a CPU stall for the time specified by stall_cpu.
2448+
* induces a CPU stall for the time specified by stall_cpu. If a new
2449+
* stall test is added, stallsdone in rcu_torture_writer() must be adjusted.
24452450
*/
24462451
static int rcu_torture_stall(void *args)
24472452
{

0 commit comments

Comments
 (0)