Re: [PATCH] hung_task: Panic after fixed number of hung tasks

From: Hillf Danton
Date: Thu Sep 25 2025 - 03:37:49 EST


On Thu, 25 Sep 2025 14:06:05 +0800
> From: Li RongQing <lirongqing@xxxxxxxxx>
>
> 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.