Skip to content

Commit 8b5ddf8

Browse files
committed
rcutorture: Separate warnings for each failure type
Currently, each of six different types of failure triggers a single WARN_ON_ONCE(), and it is then necessary to stare at the rcu_torture_stats(), Reader Pipe, and Reader Batch lines looking for inappropriately non-zero values. This can be annoying and error-prone, so this commit provides a separate WARN_ON_ONCE() for each of the six error conditions and adds short comments to each to ease error identification. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent b3ffb20 commit 8b5ddf8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

kernel/rcu/rcutorture.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,15 +1442,18 @@ rcu_torture_stats_print(void)
14421442
n_rcu_torture_barrier_error);
14431443

14441444
pr_alert("%s%s ", torture_type, TORTURE_FLAG);
1445-
if (atomic_read(&n_rcu_torture_mberror) != 0 ||
1446-
n_rcu_torture_barrier_error != 0 ||
1447-
n_rcu_torture_boost_ktrerror != 0 ||
1448-
n_rcu_torture_boost_rterror != 0 ||
1449-
n_rcu_torture_boost_failure != 0 ||
1445+
if (atomic_read(&n_rcu_torture_mberror) ||
1446+
n_rcu_torture_barrier_error || n_rcu_torture_boost_ktrerror ||
1447+
n_rcu_torture_boost_rterror || n_rcu_torture_boost_failure ||
14501448
i > 1) {
14511449
pr_cont("%s", "!!! ");
14521450
atomic_inc(&n_rcu_torture_error);
1453-
WARN_ON_ONCE(1);
1451+
WARN_ON_ONCE(atomic_read(&n_rcu_torture_mberror));
1452+
WARN_ON_ONCE(n_rcu_torture_barrier_error); // rcu_barrier()
1453+
WARN_ON_ONCE(n_rcu_torture_boost_ktrerror); // no boost kthread
1454+
WARN_ON_ONCE(n_rcu_torture_boost_rterror); // can't set RT prio
1455+
WARN_ON_ONCE(n_rcu_torture_boost_failure); // RCU boost failed
1456+
WARN_ON_ONCE(i > 1); // Too-short grace period
14541457
}
14551458
pr_cont("Reader Pipe: ");
14561459
for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)

0 commit comments

Comments
 (0)