[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8c6762c-e08c-4b7a-92e9-7dad17ad0b49@infradead.org>
Date: Fri, 10 Oct 2025 17:25:05 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: lirongqing <lirongqing@...du.com>, corbet@....net,
akpm@...ux-foundation.org, lance.yang@...ux.dev, mhiramat@...nel.org,
paulmck@...nel.org, pawan.kumar.gupta@...ux.intel.com, mingo@...nel.org,
dave.hansen@...ux.intel.com, rostedt@...dmis.org, kees@...nel.org,
arnd@...db.de, feng.tang@...ux.alibaba.com, pauld@...hat.com,
joel.granados@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][v2] hung_task: Panic after fixed number of hung tasks
Hi,
On 9/27/25 10:31 PM, lirongqing wrote:
> From: Li RongQing <lirongqing@...du.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.
>
> Acked-by: Lance Yang <lance.yang@...ux.dev>
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> ---
> Diff with v1: change documentation as Lance suggested
>
> Documentation/admin-guide/sysctl/kernel.rst | 8 ++++++++
> kernel/hung_task.c | 14 +++++++++++++-
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index 8b49eab..98b47a7 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -405,6 +405,14 @@ This file shows up if ``CONFIG_DETECT_HUNG_TASK`` is enabled.
> 1 Panic immediately.
> = =================================================
>
> +hung_task_count_to_panic
> +=====================
The underline length should be at least as long as the title to
prevent kernel-doc build warnings. Same length is preferred.
> +
> +When set to a non-zero value, a kernel panic will be triggered if the
> +number of detected hung tasks reaches this value.
> +
> +Note that setting hung_task_panic=1 will still cause an immediate panic
> +on the first hung task.
>
> hung_task_check_count
> =====================
--
~Randy
Powered by blists - more mailing lists