[PATCH] sched/debug,sched/core: Reset hung task detector while processing sysrq-t

From: Qingjie Xing
Date: Wed Jun 07 2023 - 14:23:07 EST


On devices with multiple CPUs and multiple processes, outputting lengthy
sysrq-t content on a slow serial port can consume a significant amount
of time. We need to reset the hung task detector to avoid false hung task
alerts.

Signed-off-by: Qingjie Xing <xqjcool@xxxxxxxxx>
---
kernel/sched/core.c | 1 +
kernel/sched/debug.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a68d1276bab0..5773283b752c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -9176,6 +9176,7 @@ void show_state_filter(unsigned int state_filter)
*/
touch_nmi_watchdog();
touch_all_softlockup_watchdogs();
+ reset_hung_task_detector();
if (state_filter_match(state_filter, p))
sched_show_task(p);
}
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 0b2340a79b65..43065808b425 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -904,6 +904,7 @@ void sysrq_sched_debug_show(void)
*/
touch_nmi_watchdog();
touch_all_softlockup_watchdogs();
+ reset_hung_task_detector();
print_cpu(NULL, cpu);
}
}
--
2.40.1