Re: [PATCH 0/3] Suppress undesirable hung task warnings.

From: Andrew Morton

Date: Mon Sep 22 2025 - 17:57:56 EST


On Mon, 22 Sep 2025 19:38:21 +0800 Lance Yang <lance.yang@xxxxxxxxx> wrote:

> On 2025/9/22 17:41, Julian Sun wrote:
> > As suggested by Andrew Morton in [1], we need a general mechanism
> > that allows the hung task detector to ignore unnecessary hung
>
> Yep, I understand the goal is to suppress what can be a benign hung task
> warning during memcg teardown.
>
> > tasks. This patch set implements this functionality.
> >
> > Patch 1 introduces a PF_DONT_HUNG flag. The hung task detector will
> > ignores all tasks that have the PF_DONT_HUNG flag set.
>
> However, I'm concerned that the PF_DONT_HUNG flag is a bit too powerful
> and might mask real, underlying hangs.

I think that's OK if the calling task is discriminating about it. Just
set PF_DONT_HUNG (unpleasing name!) around those bits of code where
it's needed, clear it otherwise.

Julian, did you take a look at what a touch_hung_task_detector() would
involve? It's a bit of an interface inconsistency - our various other
timeout detectors (softlockup, NMI, rcu) each have a touch_ function.