Skip to content

Commit edf3775

Browse files
committed
rcu-tasks: Add count for idle tasks on offline CPUs
This commit adds a counter for the number of times the quiescent state was an idle task associated with an offline CPU, and prints this count at the end of rcutorture runs and at stall time. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 4047150 commit edf3775

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/rcu/tasks.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ static DEFINE_PER_CPU(bool, trc_ipi_to_cpu);
729729
// heavyweight readers executing explicit memory barriers.
730730
unsigned long n_heavy_reader_attempts;
731731
unsigned long n_heavy_reader_updates;
732+
unsigned long n_heavy_reader_ofl_updates;
732733

733734
void call_rcu_tasks_trace(struct rcu_head *rhp, rcu_callback_t func);
734735
DEFINE_RCU_TASKS(rcu_tasks_trace, rcu_tasks_wait_gp, call_rcu_tasks_trace,
@@ -840,6 +841,8 @@ static bool trc_inspect_reader(struct task_struct *t, void *arg)
840841
!rcu_dynticks_zero_in_eqs(cpu, &t->trc_reader_nesting))
841842
return false; // No quiescent state, do it the hard way.
842843
n_heavy_reader_updates++;
844+
if (ofl)
845+
n_heavy_reader_ofl_updates++;
843846
in_qs = true;
844847
} else {
845848
in_qs = likely(!t->trc_reader_nesting);
@@ -1156,7 +1159,8 @@ static void show_rcu_tasks_trace_gp_kthread(void)
11561159
{
11571160
char buf[64];
11581161

1159-
sprintf(buf, "N%d h:%lu/%lu", atomic_read(&trc_n_readers_need_end),
1162+
sprintf(buf, "N%d h:%lu/%lu/%lu", atomic_read(&trc_n_readers_need_end),
1163+
data_race(n_heavy_reader_ofl_updates),
11601164
data_race(n_heavy_reader_updates),
11611165
data_race(n_heavy_reader_attempts));
11621166
show_rcu_tasks_generic_gp_kthread(&rcu_tasks_trace, buf);

0 commit comments

Comments
 (0)