]> www.infradead.org Git - users/willy/xarray.git/commit
rcu: Defer printing stall-warning backtrace when holding rcu_node lock
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 23 Aug 2024 21:15:12 +0000 (14:15 -0700)
committerNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
Sun, 8 Sep 2024 18:36:44 +0000 (00:06 +0530)
commit1ecd9d68eb44e4b7972aee2840eb4fdf29b9de2b
treeb532b33a6df684d32d27975a7bc09fa42497cfe8
parent51b739990cc81316768b85db519eac3999ba92a9
rcu: Defer printing stall-warning backtrace when holding rcu_node lock

The rcu_dump_cpu_stacks() holds the leaf rcu_node structure's ->lock
when dumping the stakcks of any CPUs stalling the current grace period.
This lock is held to prevent confusion that would otherwise occur when
the stalled CPU reported its quiescent state (and then went on to do
unrelated things) just as the backtrace NMI was heading towards it.

This has worked well, but on larger systems has recently been observed
to cause severe lock contention resulting in CSD-lock stalls and other
general unhappiness.

This commit therefore does printk_deferred_enter() before acquiring
the lock and printk_deferred_exit() after releasing it, thus deferring
the overhead of actually outputting the stack trace out of that lock's
critical section.

Reported-by: Rik van Riel <riel@surriel.com>
Suggested-by: Rik van Riel <riel@surriel.com>
Signed-off-by: "Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
kernel/rcu/tree_stall.h