Re: [PATCH] hung_task: Add per-round stack trace deduplication
From: David Laight
Date: Wed Jun 17 2026 - 18:05:01 EST
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.
>
> Introduce a lightweight, hash-based stack trace deduplicator for
> khungtaskd to ensure only unique stack traces are reported during
> a single detection interval.
How many different stacks do you need to suppress?
Mostly wont it be 'the same as the last one'?
So just a linear scan through a very small number of entries will
largely DTRT.
Much simpler code and a much smaller data footprint.
David