RE: [????] Re: [PATCH][RFC] hung_task: Support to panic when the maximum number of hung task warnings is reached
From: Li,Rongqing
Date: Tue Sep 23 2025 - 00:00:57 EST
> -----Original Message-----
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Sent: 2025年9月23日 11:46
> To: Li,Rongqing <lirongqing@xxxxxxxxx>
> Cc: corbet@xxxxxxx; lance.yang@xxxxxxxxx; mhiramat@xxxxxxxxxx;
> paulmck@xxxxxxxxxx; pawan.kumar.gupta@xxxxxxxxxxxxxxx; mingo@xxxxxxxxxx;
> dave.hansen@xxxxxxxxxxxxxxx; rostedt@xxxxxxxxxxx; kees@xxxxxxxxxx;
> arnd@xxxxxxxx; feng.tang@xxxxxxxxxxxxxxxxx; pauld@xxxxxxxxxx;
> joel.granados@xxxxxxxxxx; linux-doc@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: [????] Re: [PATCH][RFC] hung_task: Support to panic when the
> maximum number of hung task warnings is reached
>
> On Tue, 23 Sep 2025 11:37:40 +0800 lirongqing <lirongqing@xxxxxxxxx> wrote:
>
> > Currently the hung task detector can either panic immediately or
> > continue operation when hung tasks are detected. However, there are
> > scenarios where we want a more balanced approach:
> >
> > - We don't want the system to panic immediately when a few hung tasks
> > are detected, as the system may be able to recover
> > - And we also don't want the system to stall indefinitely with multiple
> > hung tasks
> >
> > This commit introduces a new mode (value 2) for the hung task panic behavior.
> > When set to 2, the system will panic only after the maximum number of
> > hung task warnings (hung_task_warnings) has been reached.
> >
> > This provides a middle ground between immediate panic and potentially
> > infinite stall, allowing for automated vmcore generation after a
> > reasonable
>
> I assume the same argument applies to the NMI watchdog, to the softlockup
> detector and to the RCU stall detector?
True, especial RCU stall detector
>
> A general framework to handle all of these might be better. But why do it in
> kernel at all? What about a userspace detector which parses kernel logs (or
> new procfs counters) and makes such decisions?
By leveraging existing kernel mechanisms, implementation in kernel is very simple and reliable, I think
Thanks
-Li