Skip to content

Commit 3b47682

Browse files
paulmckrcuurezki
authored andcommitted
rcutorture: Decorate failing reader segments with last CPU ID
In kernels built with CONFIG_RCU_TORTURE_TEST_LOG_CPU=y, the CPU is logged at the beginning of each reader segment. This commit further logs it at the end of the full set of reader segments in order to show any migration that might have occurred during the last reader segment. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Cc: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
1 parent 0f38c06 commit 3b47682

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/rcu/rcutorture.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ static int err_segs_recorded;
268268
static struct rt_read_seg err_segs[RCUTORTURE_RDR_MAX_SEGS];
269269
static int rt_read_nsegs;
270270
static int rt_read_preempted;
271+
static int rt_last_cpu;
271272

272273
static const char *rcu_torture_writer_state_getname(void)
273274
{
@@ -2108,6 +2109,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid)
21082109
}
21092110
if (cur_ops->reader_blocked)
21102111
preempted = cur_ops->reader_blocked();
2112+
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_CPU))
2113+
rt_last_cpu = raw_smp_processor_id();
21112114
rcutorture_one_extend(&readstate, 0, trsp, rtrsp);
21122115
WARN_ON_ONCE(readstate);
21132116
// This next splat is expected behavior if leakpointer, especially
@@ -3580,6 +3583,8 @@ rcu_torture_cleanup(void)
35803583
}
35813584
if (rt_read_preempted)
35823585
pr_alert("\tReader was preempted.\n");
3586+
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_CPU))
3587+
pr_alert("\tReader last ran on CPU %d.\n", rt_last_cpu);
35833588
}
35843589
if (atomic_read(&n_rcu_torture_error) || n_rcu_torture_barrier_error)
35853590
rcu_torture_print_module_parms(cur_ops, "End of test: FAILURE");

0 commit comments

Comments
 (0)