Re: [PATCH v3] hung_task: deduplicate identical hang reports
From: Aaron Tomlin
Date: Sun Jun 28 2026 - 16:30:26 EST
On Mon, Jun 22, 2026 at 05:56:55PM +0100, David Laight wrote:
> > IMHO, we should always print backtraces of all hung tasks when
> > a hung_task is detected for the 1st time. Because we do not
> > know which of the hung tasks is pointing to the root of the problem
> > and which is a secondary victim.
> >
> > Also I would primary try to increase the ring buffer size when
> > backtraces get lost.
>
> Mostly the traces wont be seen until they get written to file by syslogd
> (assuming it can run).
> So why not write them slowly enough that it keeps up?
Hi David,
Thanks for the feedback.
I am not sure rate-limiting the execution of khungtaskd would help.
The hung task detector has a hard ceiling controlled by
sysctl_hung_task_warnings. I believe the only way to eliminates ring buffer
truncation is to enforce spatial and temporal deduplication at the source.
> > Also this looks like an interesting optimization which might help
> > to reduce printing the same backtrace again and again. It looks
> > much better than the global limit of printed backtraces.
> >
> > > 3. For duplicate tasks, we still print the single-line
> > > "INFO: task ..." message and trigger tracepoint
> > > trace_sched_process_hang(). It merely skips calling
> > > sched_show_task() and debug_show_blocker(), printing a concise
> > > suppression notice instead.
> >
> > Yes, this is important as well.
>
> And would need to include the pid of the duplicate trace so you can see
> which one it is.
Indeed, this will be captured.
Kind regards,
--
Aaron Tomlin