kernel/sysrq, watchdog, sched/core: Reset watchdog on all CPUs while processing sysrq-w
authorAndrey Ryabinin <>
Thu, 9 Jun 2016 12:20:05 +0000 (15:20 +0300)
committerBen Hutchings <>
Mon, 22 Aug 2016 21:37:14 +0000 (22:37 +0100)
commit 57675cb976eff977aefb428e68e4e0236d48a9ff upstream.

Lengthy output of sysrq-w may take a lot of time on slow serial console.

Currently we reset NMI-watchdog on the current CPU to avoid spurious
lockup messages. Sometimes this doesn't work since softlockup watchdog
might trigger on another CPU which is waiting for an IPI to proceed.
We reset softlockup watchdogs on all CPUs, but we do this only after
listing all tasks, and this may be too late on a busy system.

So, reset watchdogs CPUs earlier, in for_each_process_thread() loop.

Signed-off-by: Andrey Ryabinin <>
Cc: Linus Torvalds <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Signed-off-by: Ingo Molnar <>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <>

index 7d98d58..fb55429 100644 (file)
@@ -6260,14 +6260,16 @@ void show_state_filter(unsigned long state_filter)
                 * reset the NMI-timeout, listing all files on a slow
                 * console might take a lot of time:
+                * Also, reset softlockup watchdogs on all CPUs, because
+                * another CPU might be blocked waiting for us to process
+                * an IPI.
+               touch_all_softlockup_watchdogs();
                if (!state_filter || (p->state & state_filter))
        } while_each_thread(g, p);
-       touch_all_softlockup_watchdogs();