Skip to content

Commit

Permalink
rcu: Dump local stack if cannot dump all CPUs' stacks
Browse files Browse the repository at this point in the history
The trigger_all_cpu_backtrace() function is a no-op in architectures that
do not define arch_trigger_all_cpu_backtrace.  On such architectures, RCU
CPU stall warning messages contain no stack trace information, which makes
debugging quite difficult.  This commit therefore substitutes dump_stack()
for architectures that do not define arch_trigger_all_cpu_backtrace,
so that at least the local CPU's stack is dumped as part of the RCU CPU
stall warning message.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Paul E. McKenney committed Sep 29, 2011
1 parent 6206ab9 commit 4627e24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
}
printk("} (detected by %d, t=%ld jiffies)\n",
smp_processor_id(), (long)(jiffies - rsp->gp_start));
trigger_all_cpu_backtrace();
if (!trigger_all_cpu_backtrace())
dump_stack();

/* If so configured, complain about tasks blocking the grace period. */

Expand All @@ -604,7 +605,8 @@ static void print_cpu_stall(struct rcu_state *rsp)
*/
printk(KERN_ERR "INFO: %s detected stall on CPU %d (t=%lu jiffies)\n",
rsp->name, smp_processor_id(), jiffies - rsp->gp_start);
trigger_all_cpu_backtrace();
if (!trigger_all_cpu_backtrace())
dump_stack();

raw_spin_lock_irqsave(&rnp->lock, flags);
if (ULONG_CMP_GE(jiffies, rsp->jiffies_stall))
Expand Down

0 comments on commit 4627e24

Please sign in to comment.