Re: [PATCH v6] hung_task: Deduplicate identical hang reports using explicit blocker tracking
From: Aaron Tomlin
Date: Mon Jul 20 2026 - 22:00:57 EST
On Sun, Jul 19, 2026 at 11:02:57PM -0700, Andrew Morton wrote:
> On Sun, 19 Jul 2026 12:13:05 -0400 Aaron Tomlin <atomlin@xxxxxxxxxxx> wrote:
>
> > Currently, during severe lock contention, multiple tasks can hang while
> > waiting on the exact same resource. The khungtaskd kthread
> > indiscriminately reports every single instance with a stack trace.
> > This can roll the kernel ring buffer and prematurely exhaust the
> > kernel.hung_task_warnings budget. Consequently, the kernel is left
> > entirely blind to subsequent, unrelated deadlocks.
>
> This does seem something we'd like to address.
>
> > To preserve the warning budget and ring buffer without sacrificing
> > observability, this patch introduces a two-tier deduplication mechanism:
> >
>
> Thanks. Hopefully Petr and Lance will be able to review this version.
>
> AI review might have found an issue:
> https://sashiko.dev/#/patchset/20260719161305.428947-1-atomlin@xxxxxxxxxxx
Hi Andrew,
Thank you for you feedback.
This is indeed a legitimate issue.
I have moved the panic threshold check out of hung_task_info() and placing
it directly into check_hung_uninterruptible_tasks() right after
this_round_count is incremented.
This ensures that:
1. The panic threshold is correctly evaluated for all hung tasks,
regardless of whether they have already been reported
2. If the panic threshold is reached, hung_task_call_panic is set to
true, ensuring the watchdog successfully panics and dumps the
system state
3. We still completely suppress the redundant stack traces for
already-reported tasks (i.e., preventing log spam and preserving
the global warning budget)
Kind regards,
--
Aaron Tomlin