Skip to content

Commit bc1dce5

Browse files
committed
rcu: Don't use NMIs to dump other CPUs' stacks
Although NMI-based stack dumps are in principle more accurate, they are also more likely to trigger deadlocks. This commit therefore replaces all uses of trigger_all_cpu_backtrace() with rcu_dump_cpu_stacks(), so that the CPU detecting an RCU CPU stall does the stack dumping. Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Lai Jiangshan <[email protected]>
1 parent c0f489d commit bc1dce5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

kernel/rcu/tree.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,10 +1013,7 @@ static void record_gp_stall_check_time(struct rcu_state *rsp)
10131013
}
10141014

10151015
/*
1016-
* Dump stacks of all tasks running on stalled CPUs. This is a fallback
1017-
* for architectures that do not implement trigger_all_cpu_backtrace().
1018-
* The NMI-triggered stack traces are more accurate because they are
1019-
* printed by the target CPU.
1016+
* Dump stacks of all tasks running on stalled CPUs.
10201017
*/
10211018
static void rcu_dump_cpu_stacks(struct rcu_state *rsp)
10221019
{
@@ -1094,7 +1091,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
10941091
(long)rsp->gpnum, (long)rsp->completed, totqlen);
10951092
if (ndetected == 0)
10961093
pr_err("INFO: Stall ended before state dump start\n");
1097-
else if (!trigger_all_cpu_backtrace())
1094+
else
10981095
rcu_dump_cpu_stacks(rsp);
10991096

11001097
/* Complain about tasks blocking the grace period. */
@@ -1125,8 +1122,7 @@ static void print_cpu_stall(struct rcu_state *rsp)
11251122
pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n",
11261123
jiffies - rsp->gp_start,
11271124
(long)rsp->gpnum, (long)rsp->completed, totqlen);
1128-
if (!trigger_all_cpu_backtrace())
1129-
dump_stack();
1125+
rcu_dump_cpu_stacks(rsp);
11301126

11311127
raw_spin_lock_irqsave(&rnp->lock, flags);
11321128
if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall)))

0 commit comments

Comments
 (0)