powerpc/watchdog: Do not backtrace locked CPUs twice if allcpus backtrace is enabled
authorNicholas Piggin <npiggin@gmail.com>
Fri, 29 Sep 2017 03:29:38 +0000 (13:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Oct 2017 00:25:50 +0000 (11:25 +1100)
If sysctl_hardlockup_all_cpu_backtrace is enabled, there is no need to
IPI stuck CPUs for backtrace before trigger_allbutself_cpu_backtrace(),
which does the same thing again.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/watchdog.c

index 532a1ad..920e61c 100644 (file)
@@ -133,15 +133,18 @@ static void watchdog_smp_panic(int cpu, u64 tb)
        pr_emerg("Watchdog CPU:%d detected Hard LOCKUP other CPUS:%*pbl\n",
                        cpu, cpumask_pr_args(&wd_smp_cpus_pending));
 
-       /*
-        * Try to trigger the stuck CPUs.
-        */
-       for_each_cpu(c, &wd_smp_cpus_pending) {
-               if (c == cpu)
-                       continue;
-               smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
+       if (!sysctl_hardlockup_all_cpu_backtrace) {
+               /*
+                * Try to trigger the stuck CPUs, unless we are going to
+                * get a backtrace on all of them anyway.
+                */
+               for_each_cpu(c, &wd_smp_cpus_pending) {
+                       if (c == cpu)
+                               continue;
+                       smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
+               }
+               smp_flush_nmi_ipi(1000000);
        }
-       smp_flush_nmi_ipi(1000000);
 
        /* Take the stuck CPUs out of the watch group */
        set_cpumask_stuck(&wd_smp_cpus_pending, tb);