Re: [PATCH v9 2/2] hung_task: Log summary line when warning budget is exhausted
From: Lance Yang
Date: Fri Aug 14 2026 - 12:27:57 EST
On Fri, Aug 14, 2026 at 09:57:18AM -0400, Aaron Tomlin wrote:
>Once the warning budget is exhausted, hung_task_info() stops printing
>per-task details. To provide visibility without causing additional log
>spam, emit a single aggregate summary line at the end of each watchdog
>scan when hung tasks are detected and the warning budget is exhausted.
>
>Keep per-task reports budgeted to avoid flooding dmesg or causing
>ring buffer overflows during system-wide hangs.
Hm... not quite unconditional. hung_task_call_panic still gets through
budget gate, so with hung_task_warnings=1 and hung_task_panic=2, first
task can exhaust budget and second one still gets full details (right
before panic).
I'd write changelog like this:
Once the warning budget is exhausted, hung_task_info() normally stops
printing per-task details. When panic is triggered, full details are
still printed so diagnostics remain available before panic.
To retain visibility without restoring per-task output after budget
exhaustion, emit a single aggregate summary line at the end of each
watchdog scan that detects hung tasks with an exhausted budget. This
keeps non-panic per-task reports budgeted during system-wide hangs.
>
>Suggested-by: Petr Mladek <pmladek@xxxxxxxx>
>Suggested-by: Lance Yang <lance.yang@xxxxxxxxx>
>Signed-off-by: Aaron Tomlin <atomlin@xxxxxxxxxxx>
>---
> kernel/hung_task.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
>diff --git a/kernel/hung_task.c b/kernel/hung_task.c
>index 53499fbead83..f5eb75325f3a 100644
>--- a/kernel/hung_task.c
>+++ b/kernel/hung_task.c
>@@ -268,7 +268,7 @@ static void hung_task_info(struct task_struct *t, unsigned long timeout,
> debug_show_blocker(t, timeout);
>
> if (!hung_task_warnings_printed)
>- pr_info("Future hung task reports are suppressed, see sysctl kernel.hung_task_warnings\n");
>+ pr_info("Future hung task reports won't print details about each process, see sysctl kernel.hung_task_warnings\n");
Same exception here... next task can hit panic threshold and print full
details anyway (and this line can be printed while hung_task_call_panic
is already set).
I'd make condition and message match actual behavior:
"hung_task: further per-task details suppressed until warning budget is
reset or panic is triggered (see sysctl kernel.hung_task_warnings)\n"
No need to resend just for these ... I think Andrew can fix them up when
applying :)
Otherwise, LGTM.
Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>