Skip to content

Commit

Permalink
rcu: Suppress smp_processor_id() complaint in synchronize_rcu_expedit…
Browse files Browse the repository at this point in the history
…ed_wait()

The normal grace period's RCU CPU stall warnings are invoked from the
scheduling-clock interrupt handler, and can thus invoke smp_processor_id()
with impunity, which allows them to directly invoke dump_cpu_task().
In contrast, the expedited grace period's RCU CPU stall warnings are
invoked from process context, which causes the dump_cpu_task() function's
calls to smp_processor_id() to complain bitterly in debug kernels.

This commit therefore causes synchronize_rcu_expedited_wait() to disable
preemption around its call to dump_cpu_task().

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
Paul E. McKenney committed Jan 4, 2023
1 parent 0cae5de commit 2d7f00b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/rcu/tree_exp.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,9 @@ static void synchronize_rcu_expedited_wait(void)
mask = leaf_node_cpu_bit(rnp, cpu);
if (!(READ_ONCE(rnp->expmask) & mask))
continue;
preempt_disable(); // For smp_processor_id() in dump_cpu_task().
dump_cpu_task(cpu);
preempt_enable();
}
}
jiffies_stall = 3 * rcu_exp_jiffies_till_stall_check() + 3;
Expand Down

0 comments on commit 2d7f00b

Please sign in to comment.