]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
watchdog: trigger all-cpu backtrace when locked up and going to panic
authorSasha Levin <sasha.levin@oracle.com>
Thu, 18 Jul 2013 23:56:40 +0000 (09:56 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 18 Jul 2013 23:56:40 +0000 (09:56 +1000)
Send an NMI to all CPUs when a lockup is detected and the lockup watchdog
code is configured to panic.  This gives us a fairly uptodate snapshot of
all CPUs in the system.

This lets us get stack trace of all CPUs which makes life easier trying to
debug a deadlock, and the NMI doesn't change anything since the next step
is a kernel panic.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/watchdog.c

index 1241d8c91d5e75efb3ba08ff18109a0a4f84e12c..d24c4bbb2d7c091a788f1097b1652964ab7b0dba 100644 (file)
@@ -239,10 +239,12 @@ static void watchdog_overflow_callback(struct perf_event *event,
                if (__this_cpu_read(hard_watchdog_warn) == true)
                        return;
 
-               if (hardlockup_panic)
+               if (hardlockup_panic) {
+                       trigger_all_cpu_backtrace();
                        panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
-               else
+               } else {
                        WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
+               }
 
                __this_cpu_write(hard_watchdog_warn, true);
                return;
@@ -323,8 +325,10 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
                else
                        dump_stack();
 
-               if (softlockup_panic)
+               if (softlockup_panic) {
+                       trigger_all_cpu_backtrace();
                        panic("softlockup: hung tasks");
+               }
                __this_cpu_write(soft_watchdog_warn, true);
        } else
                __this_cpu_write(soft_watchdog_warn, false);