diff options
author | 2024-10-28 16:58:51 -0700 | |
---|---|---|
committer | 2024-12-14 17:04:08 +0100 | |
commit | 3b476823b98685ec4d228af32323854f8e45aac7 (patch) | |
tree | f4b15b71ba9dfaabbec0bbeda725ccccac49273a | |
parent | rcutorture: Check preemption for failing reader (diff) | |
download | wireguard-linux-3b476823b98685ec4d228af32323854f8e45aac7.tar.xz wireguard-linux-3b476823b98685ec4d228af32323854f8e45aac7.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | kernel/rcu/rcutorture.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 9b81e21c75d1..61b092a3dc3f 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -268,6 +268,7 @@ static int err_segs_recorded; static struct rt_read_seg err_segs[RCUTORTURE_RDR_MAX_SEGS]; static int rt_read_nsegs; static int rt_read_preempted; +static int rt_last_cpu; static const char *rcu_torture_writer_state_getname(void) { @@ -2108,6 +2109,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid) } if (cur_ops->reader_blocked) preempted = cur_ops->reader_blocked(); + if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_CPU)) + rt_last_cpu = raw_smp_processor_id(); rcutorture_one_extend(&readstate, 0, trsp, rtrsp); WARN_ON_ONCE(readstate); // This next splat is expected behavior if leakpointer, especially @@ -3580,6 +3583,8 @@ rcu_torture_cleanup(void) } if (rt_read_preempted) pr_alert("\tReader was preempted.\n"); + if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_CPU)) + pr_alert("\tReader last ran on CPU %d.\n", rt_last_cpu); } if (atomic_read(&n_rcu_torture_error) || n_rcu_torture_barrier_error) rcu_torture_print_module_parms(cur_ops, "End of test: FAILURE"); |