Skip to content

Commit

Permalink
rcu: Print human-readable message for schedule() in RCU reader
Browse files Browse the repository at this point in the history
The WARN_ON_ONCE() invocation within the CONFIG_PREEMPT=y version of
rcu_note_context_switch() triggers when there is a voluntary context
switch in an RCU read-side critical section, but there is quite a gap
between the output of that WARN_ON_ONCE() and this RCU-usage error.
This commit therefore converts the WARN_ON_ONCE() to a WARN_ONCE()
that explicitly describes the problem in its message.

Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmckrcu committed Aug 6, 2021
1 parent 5089582 commit 521c89b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/rcu/tree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void rcu_note_context_switch(bool preempt)

trace_rcu_utilization(TPS("Start context switch"));
lockdep_assert_irqs_disabled();
WARN_ON_ONCE(!preempt && rcu_preempt_depth() > 0);
WARN_ONCE(!preempt && rcu_preempt_depth() > 0, "Voluntary context switch within RCU read-side critical section!");
if (rcu_preempt_depth() > 0 &&
!t->rcu_read_unlock_special.b.blocked) {

Expand Down

0 comments on commit 521c89b

Please sign in to comment.