[Devel] [PATCH rh7] kernel/sysrq: restore touch_nmi_watchdog() in show_state_filter()

Andrey Ryabinin aryabinin at virtuozzo.com
Tue Jun 14 05:10:49 PDT 2016


Commit 60c21d9f08bf ("kernel/sysrq: reset watchdog on all cpus while during sysrq-w")
shouldn't remove touch_nmi_watchdog() call because touch_all_softlockup_watchdogs()
resets only softlockup watchdogs, but doesn't reset NMI watchdog used in hard lockup
detector.

So, bring it back. Plus, remove the second touch_all_softlockup_watchdogs() call
which becomes redundant, and add a comment.

This patch is delta between v2-v1 version of the upstream patch:
	http://lkml.kernel.org/g/1465474805-14641-1-git-send-email-aryabinin@virtuozzo.com

https://jira.sw.ru/browse/PSBM-47486

Fixes: 60c21d9f08bf ("kernel/sysrq: reset watchdog on all cpus while during sysrq-w")
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/sched/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d21ccf0..1a3ff8c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5176,14 +5176,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_nmi_watchdog();
 		touch_all_softlockup_watchdogs();
 		if (!state_filter || (p->state & state_filter))
 			sched_show_task(p);
 	} while_each_thread(g, p);
 
-	touch_all_softlockup_watchdogs();
-
 #if 0
 	/*
 	 * This results in soft lockups, because it writes too much data to
-- 
2.7.3



More information about the Devel mailing list