Commit bc1dce51 authored by Paul E. McKenney's avatar Paul E. McKenney

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
parent c0f489d2
...@@ -1013,10 +1013,7 @@ static void record_gp_stall_check_time(struct rcu_state *rsp) ...@@ -1013,10 +1013,7 @@ static void record_gp_stall_check_time(struct rcu_state *rsp)
} }
/* /*
* Dump stacks of all tasks running on stalled CPUs. This is a fallback * Dump stacks of all tasks running on stalled CPUs.
* for architectures that do not implement trigger_all_cpu_backtrace().
* The NMI-triggered stack traces are more accurate because they are
* printed by the target CPU.
*/ */
static void rcu_dump_cpu_stacks(struct rcu_state *rsp) static void rcu_dump_cpu_stacks(struct rcu_state *rsp)
{ {
...@@ -1094,7 +1091,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp) ...@@ -1094,7 +1091,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
(long)rsp->gpnum, (long)rsp->completed, totqlen); (long)rsp->gpnum, (long)rsp->completed, totqlen);
if (ndetected == 0) if (ndetected == 0)
pr_err("INFO: Stall ended before state dump start\n"); pr_err("INFO: Stall ended before state dump start\n");
else if (!trigger_all_cpu_backtrace()) else
rcu_dump_cpu_stacks(rsp); rcu_dump_cpu_stacks(rsp);
/* Complain about tasks blocking the grace period. */ /* Complain about tasks blocking the grace period. */
...@@ -1125,8 +1122,7 @@ static void print_cpu_stall(struct rcu_state *rsp) ...@@ -1125,8 +1122,7 @@ static void print_cpu_stall(struct rcu_state *rsp)
pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n", pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n",
jiffies - rsp->gp_start, jiffies - rsp->gp_start,
(long)rsp->gpnum, (long)rsp->completed, totqlen); (long)rsp->gpnum, (long)rsp->completed, totqlen);
if (!trigger_all_cpu_backtrace()) rcu_dump_cpu_stacks(rsp);
dump_stack();
raw_spin_lock_irqsave(&rnp->lock, flags); raw_spin_lock_irqsave(&rnp->lock, flags);
if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall))) if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment