diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4317f0156092a10734bd2d93482b70ea650e081e..2f774edcc4e896d9d277c7efff1a047f343386b8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4595,14 +4595,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);
 	}
 
-	touch_all_softlockup_watchdogs();
-
 #ifdef CONFIG_SCHED_DEBUG
 	sysrq_sched_debug_show();
 #endif