diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2012-09-19 19:58:38 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-10-23 17:55:25 -0400 |
commit | b637a328bd4f43a0e146d1eef0142b650ba0d644 (patch) | |
tree | f1bcf34f229b9ab62612971903ccd61d05db7aea /kernel/rcutree.c | |
parent | 6f0c0580b70c89094b3422ba81118c7b959c7556 (diff) |
rcu: Print remote CPU's stacks in stall warnings
The RCU CPU stall warnings rely on trigger_all_cpu_backtrace() to
do NMI-based dump of the stack traces of all CPUs. Unfortunately, a
number of architectures do not implement trigger_all_cpu_backtrace(), in
which case RCU falls back to just dumping the stack of the running CPU.
This is unhelpful in the case where the running CPU has detected that
some other CPU has stalled.
This commit therefore makes the running CPU dump the stacks of the
tasks running on the stalled CPUs.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 74df86bd9204..e78538712df0 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -873,6 +873,29 @@ static void record_gp_stall_check_time(struct rcu_state *rsp) | |||
873 | rsp->jiffies_stall = jiffies + jiffies_till_stall_check(); | 873 | rsp->jiffies_stall = jiffies + jiffies_till_stall_check(); |
874 | } | 874 | } |
875 | 875 | ||
876 | /* | ||
877 | * Dump stacks of all tasks running on stalled CPUs. This is a fallback | ||
878 | * for architectures that do not implement trigger_all_cpu_backtrace(). | ||
879 | * The NMI-triggered stack traces are more accurate because they are | ||
880 | * printed by the target CPU. | ||
881 | */ | ||
882 | static void rcu_dump_cpu_stacks(struct rcu_state *rsp) | ||
883 | { | ||
884 | int cpu; | ||
885 | unsigned long flags; | ||
886 | struct rcu_node *rnp; | ||
887 | |||
888 | rcu_for_each_leaf_node(rsp, rnp) { | ||
889 | raw_spin_lock_irqsave(&rnp->lock, flags); | ||
890 | if (rnp->qsmask != 0) { | ||
891 | for (cpu = 0; cpu <= rnp->grphi - rnp->grplo; cpu++) | ||
892 | if (rnp->qsmask & (1UL << cpu)) | ||
893 | dump_cpu_task(rnp->grplo + cpu); | ||
894 | } | ||
895 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | ||
896 | } | ||
897 | } | ||
898 | |||
876 | static void print_other_cpu_stall(struct rcu_state *rsp) | 899 | static void print_other_cpu_stall(struct rcu_state *rsp) |
877 | { | 900 | { |
878 | int cpu; | 901 | int cpu; |
@@ -929,7 +952,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
929 | if (ndetected == 0) | 952 | if (ndetected == 0) |
930 | printk(KERN_ERR "INFO: Stall ended before state dump start\n"); | 953 | printk(KERN_ERR "INFO: Stall ended before state dump start\n"); |
931 | else if (!trigger_all_cpu_backtrace()) | 954 | else if (!trigger_all_cpu_backtrace()) |
932 | dump_stack(); | 955 | rcu_dump_cpu_stacks(rsp); |
933 | 956 | ||
934 | /* Complain about tasks blocking the grace period. */ | 957 | /* Complain about tasks blocking the grace period. */ |
935 | 958 | ||