Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Paul E. McKenney and committed by
Boqun Feng
fd2a749d 67050837

+9 -4
+9 -4
kernel/rcu/rcutorture.c
··· 1368 1368 struct rcu_torture *rp; 1369 1369 struct rcu_torture *old_rp; 1370 1370 static DEFINE_TORTURE_RANDOM(rand); 1371 + unsigned long stallsdone = jiffies; 1371 1372 bool stutter_waited; 1372 1373 unsigned long ulo[NUM_ACTIVE_RCU_POLL_OLDSTATE]; 1373 1374 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; 1374 1378 VERBOSE_TOROUT_STRING("rcu_torture_writer task started"); 1375 1379 if (!can_expedite) 1376 1380 pr_alert("%s" TORTURE_FLAG ··· 1580 1576 !atomic_read(&rcu_fwd_cb_nodelay) && 1581 1577 !cur_ops->slow_gps && 1582 1578 !torture_must_stop() && 1583 - boot_ended) 1579 + boot_ended && 1580 + time_after(jiffies, stallsdone)) 1584 1581 for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) 1585 1582 if (list_empty(&rcu_tortures[i].rtort_free) && 1586 - rcu_access_pointer(rcu_torture_current) != 1587 - &rcu_tortures[i]) { 1583 + rcu_access_pointer(rcu_torture_current) != &rcu_tortures[i]) { 1588 1584 tracing_off(); 1589 1585 show_rcu_gp_kthreads(); 1590 1586 WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count); ··· 2445 2441 2446 2442 /* 2447 2443 * CPU-stall kthread. It waits as specified by stall_cpu_holdoff, then 2448 - * induces a CPU stall for the time specified by stall_cpu. 2444 + * induces a CPU stall for the time specified by stall_cpu. If a new 2445 + * stall test is added, stallsdone in rcu_torture_writer() must be adjusted. 2449 2446 */ 2450 2447 static int rcu_torture_stall(void *args) 2451 2448 {