diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-06-18 12:18:31 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-07-09 12:15:04 -0400 |
commit | bc1dce514e9b29b64df28a533015885862f47814 (patch) | |
tree | 72977f4949a34fa20736dfdd69c6f740ae086d37 /kernel/rcu | |
parent | c0f489d2c6fec8994c642c2ec925eb858727dc7b (diff) |
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 <paulmck@linux.vnet.ibm.com>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 3f93033d3c61..8f3e4d43d736 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -1013,10 +1013,7 @@ static void record_gp_stall_check_time(struct rcu_state *rsp) | |||
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | /* | 1015 | /* |
1016 | * Dump stacks of all tasks running on stalled CPUs. This is a fallback | 1016 | * Dump stacks of all tasks running on stalled CPUs. |
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. | ||
1020 | */ | 1017 | */ |
1021 | static void rcu_dump_cpu_stacks(struct rcu_state *rsp) | 1018 | static void rcu_dump_cpu_stacks(struct rcu_state *rsp) |
1022 | { | 1019 | { |
@@ -1094,7 +1091,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
1094 | (long)rsp->gpnum, (long)rsp->completed, totqlen); | 1091 | (long)rsp->gpnum, (long)rsp->completed, totqlen); |
1095 | if (ndetected == 0) | 1092 | if (ndetected == 0) |
1096 | pr_err("INFO: Stall ended before state dump start\n"); | 1093 | pr_err("INFO: Stall ended before state dump start\n"); |
1097 | else if (!trigger_all_cpu_backtrace()) | 1094 | else |
1098 | rcu_dump_cpu_stacks(rsp); | 1095 | rcu_dump_cpu_stacks(rsp); |
1099 | 1096 | ||
1100 | /* Complain about tasks blocking the grace period. */ | 1097 | /* Complain about tasks blocking the grace period. */ |
@@ -1125,8 +1122,7 @@ static void print_cpu_stall(struct rcu_state *rsp) | |||
1125 | pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n", | 1122 | pr_cont(" (t=%lu jiffies g=%ld c=%ld q=%lu)\n", |
1126 | jiffies - rsp->gp_start, | 1123 | jiffies - rsp->gp_start, |
1127 | (long)rsp->gpnum, (long)rsp->completed, totqlen); | 1124 | (long)rsp->gpnum, (long)rsp->completed, totqlen); |
1128 | if (!trigger_all_cpu_backtrace()) | 1125 | rcu_dump_cpu_stacks(rsp); |
1129 | dump_stack(); | ||
1130 | 1126 | ||
1131 | raw_spin_lock_irqsave(&rnp->lock, flags); | 1127 | raw_spin_lock_irqsave(&rnp->lock, flags); |
1132 | if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall))) | 1128 | if (ULONG_CMP_GE(jiffies, ACCESS_ONCE(rsp->jiffies_stall))) |