Re: [PATCH v9 2/2] hung_task: Log summary line when warning budget is exhausted

Aaron Tomlin <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <itk7tcnqtifog5cmzxb7pyslgucpb7zfoxpes2oued4zrgslly@gap7vvf4yijm>
On Sat, Aug 15, 2026 at 12:27:34AM +0800, Lance Yang wrote:
> 
> 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.

Hi Lance,

Acknowledged.

> >Suggested-by: Petr Mladek <[email protected]>
> >Suggested-by: Lance Yang <[email protected]>
> >Signed-off-by: Aaron Tomlin <[email protected]>
> >---
> > 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"

Agreed.

> No need to resend just for these ... I think Andrew can fix them up when
> applying :)
> 
> Otherwise, LGTM.
> 
> Reviewed-by: Lance Yang <[email protected]>

Understood. Thank you Lance. Andrew, please let me know if otherwise.

Kind regards,
-- 
Aaron Tomlin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.