Skip to content

Commit 223f16b

Browse files
paulmckrcuurezki
authored andcommitted
rcutorture: Add per-reader-segment preemption diagnostics
For preemptible RCU, this commit adds an indication for each reader segments to whether the rcu_torture_reader() task was on the ->blkd_tasks lists, though only in kernels built with CONFIG_RCU_TORTURE_TEST_LOG_CPU=y. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
1 parent 885a6f4 commit 223f16b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kernel/rcu/rcutorture.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,8 @@ rcu_read_delay(struct torture_random_state *rrsp, struct rt_read_seg *rtrsp)
464464
rtrsp->rt_delay_us = shortdelay_us;
465465
}
466466
if (!preempt_count() &&
467-
!(torture_random(rrsp) % (nrealreaders * 500))) {
467+
!(torture_random(rrsp) % (nrealreaders * 500)))
468468
torture_preempt_schedule(); /* QS only if preemptible. */
469-
rtrsp->rt_preempted = true;
470-
}
471469
}
472470

473471
static void rcu_torture_read_unlock(int idx)
@@ -1961,8 +1959,11 @@ static void rcutorture_one_extend(int *readstate, int newstate, bool insoftirq,
19611959
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_CPU)) {
19621960
int cpu = raw_smp_processor_id();
19631961
rtrsp->rt_cpu = cpu;
1964-
if (!first)
1962+
if (!first) {
19651963
rtrsp[-1].rt_end_cpu = cpu;
1964+
if (cur_ops->reader_blocked)
1965+
rtrsp[-1].rt_preempted = cur_ops->reader_blocked();
1966+
}
19661967
}
19671968

19681969
/*

0 commit comments

Comments
 (0)