1 From 57675cb976eff977aefb428e68e4e0236d48a9ff Mon Sep 17 00:00:00 2001
2 From: Andrey Ryabinin <aryabinin@virtuozzo.com>
3 Date: Thu, 9 Jun 2016 15:20:05 +0300
4 Subject: kernel/sysrq, watchdog, sched/core: Reset watchdog on all CPUs while processing sysrq-w
6 From: Andrey Ryabinin <aryabinin@virtuozzo.com>
8 commit 57675cb976eff977aefb428e68e4e0236d48a9ff upstream.
10 Lengthy output of sysrq-w may take a lot of time on slow serial console.
12 Currently we reset NMI-watchdog on the current CPU to avoid spurious
13 lockup messages. Sometimes this doesn't work since softlockup watchdog
14 might trigger on another CPU which is waiting for an IPI to proceed.
15 We reset softlockup watchdogs on all CPUs, but we do this only after
16 listing all tasks, and this may be too late on a busy system.
18 So, reset watchdogs CPUs earlier, in for_each_process_thread() loop.
20 Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
21 Cc: Linus Torvalds <torvalds@linux-foundation.org>
22 Cc: Peter Zijlstra <peterz@infradead.org>
23 Cc: Thomas Gleixner <tglx@linutronix.de>
24 Link: http://lkml.kernel.org/r/1465474805-14641-1-git-send-email-aryabinin@virtuozzo.com
25 Signed-off-by: Ingo Molnar <mingo@kernel.org>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 kernel/sched/core.c | 6 ++++--
30 1 file changed, 4 insertions(+), 2 deletions(-)
32 --- a/kernel/sched/core.c
33 +++ b/kernel/sched/core.c
34 @@ -4951,14 +4951,16 @@ void show_state_filter(unsigned long sta
36 * reset the NMI-timeout, listing all files on a slow
37 * console might take a lot of time:
38 + * Also, reset softlockup watchdogs on all CPUs, because
39 + * another CPU might be blocked waiting for us to process
43 + touch_all_softlockup_watchdogs();
44 if (!state_filter || (p->state & state_filter))
48 - touch_all_softlockup_watchdogs();
50 #ifdef CONFIG_SCHED_DEBUG
51 sysrq_sched_debug_show();