RE: [外部邮件] Re: [PATCH] hung_task: Panic after fixed number of hung tasks

Li,Rongqing
2025-09-25T08:03:11Z

> -----Original Message-----
> From: Hillf Danton <hdanton@sina.com>
> Sent: 2025年9月25日 15:37
> To: Li,Rongqing <lirongqing@baidu.com>
> Cc: LKML <linux-kernel@vger.kernel.org>
> Subject: [外部邮件] Re: [PATCH] hung_task: Panic after fixed number of hung
> tasks
>
> On Thu, 25 Sep 2025 14:06:05 +0800
> > From: Li RongQing <lirongqing@baidu.com>
> >
> > Currently, when hung_task_panic is enabled, kernel will panic
> > immediately upon detecting the first hung task. However, some hung
> > tasks are transient and the system can recover fully, while others are
> > unrecoverable and trigger consecutive hung task reports, and a panic is
> expected.
> >
> > This commit adds a new sysctl parameter hung_task_count_to_panic to
> > allows specifying the number of consecutive hung tasks that must be
> > detected before triggering a kernel panic. This provides finer control
> > for environments where transient hangs maybe happen but persistent
> > hangs should still be fatal.
> >
> Given transient, bumping sysctl_hung_task_timeout_secs up alone helps.

However, this will prevent the printing of hung task warnings. Hung task warnings are
very useful for identifying which tasks are hanging and where they are stuck.

If there is hung_task_count_to_panic, I hope to shorten sysctl_hung_task_timeout_secs to give more information.

Thanks