Re: [PATCH] hung_task: Add per-round stack trace deduplication

From: Aaron Tomlin

Date: Fri Jun 19 2026 - 14:00:31 EST


On Thu, Jun 18, 2026 at 09:59:53AM +0900, Masami Hiramatsu wrote:
> On Wed, 17 Jun 2026 14:48:41 -0400
> Aaron Tomlin <atomlin@xxxxxxxxxxx> wrote:
>
> > Currently, when multiple tasks hang in the exact same location (e.g.,
> > such as severe contention for a mutex), khungtaskd indiscriminately
> > reports every single instance. This wastes ring buffer space with
> > identical stack traces up to the defined warning limit (i.e.,
> > kernel.hung_task_warnings), obscuring the root cause without providing
> > any additional diagnostic value.
>
> Good work!
> And I would like to see how many tasks are stacked on the same
> place too. Can we just skip sched_show_task() instead?
>
> Thank you,
>
> --
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

Hi Masami,

Thank you for the review.

That is an excellent suggestion.

For v2, I will use the deduplicator strictly to gate the execution of
sched_show_task() and debug_show_blocker(), perhaps adding a 1-line note
indicating the duplicate trace was suppressed.

Thanks again for the guidance!


Kind regards,
--
Aaron Tomlin