[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4db3bd26-1f74-4096-84fd-f652ec9a4d27@linux.dev>
Date: Thu, 16 Oct 2025 13:07:23 +0800
From: Lance Yang <lance.yang@...ux.dev>
To: lirongqing <lirongqing@...du.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-doc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, wireguard@...ts.zx2c4.com,
netdev@...r.kernel.org, linux-kselftest@...r.kernel.org,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Jeffery <andrew@...econstruct.com.au>,
Anshuman Khandual <anshuman.khandual@....com>, Arnd Bergmann
<arnd@...db.de>, David Hildenbrand <david@...hat.com>,
Florian Wesphal <fw@...len.de>, Jakub Kacinski <kuba@...nel.org>,
"Jason A . Donenfeld" <jason@...c4.com>,
Joel Granados <joel.granados@...nel.org>, Joel Stanley <joel@....id.au>,
Jonathan Corbet <corbet@....net>, Kees Cook <kees@...nel.org>,
Liam Howlett <liam.howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Paul E . McKenney" <paulmck@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Petr Mladek <pmladek@...e.com>, Phil Auld <pauld@...hat.com>,
Randy Dunlap <rdunlap@...radead.org>, Russell King <linux@...linux.org.uk>,
Shuah Khan <shuah@...nel.org>, Simon Horman <horms@...nel.org>,
Stanislav Fomichev <sdf@...ichev.me>, Steven Rostedt <rostedt@...dmis.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][v4] hung_task: Panic when there are more than N hung
tasks at the same time
LGTM. It works as expected, thanks!
On 2025/10/15 14:36, lirongqing wrote:
> From: Li RongQing <lirongqing@...du.com>
For the commit message, I'd suggest the following for better clarity:
```
The hung_task_panic sysctl is currently a blunt instrument: it's all
or nothing.
Panicking on a single hung task can be an overreaction to a transient
glitch. A more reliable indicator of a systemic problem is when multiple
tasks hang simultaneously.
Extend hung_task_panic to accept an integer threshold, allowing the kernel
to panic only when N hung tasks are detected in a single scan. This
provides finer control to distinguish between isolated incidents and
system-wide failures.
The accepted values are:
- 0: Don't panic (unchanged)
- 1: Panic on the first hung task (unchanged)
- N > 1: Panic after N hung tasks are detected in a single scan
The original behavior is preserved for values 0 and 1, maintaining full
backward compatibility.
```
If you agree, likely no need to resend - Andrew could pick it up
directly when applying :)
>
> Currently, when 'hung_task_panic' is enabled, the kernel panics
> immediately upon detecting the first hung task. However, some hung
> tasks are transient and allow system recovery, while persistent hangs
> should trigger a panic when accumulating beyond a threshold.
>
> Extend the 'hung_task_panic' sysctl to accept a threshold value
> specifying the number of hung tasks that must be detected before
> triggering a kernel panic. This provides finer control for environments
> where transient hangs may occur but persistent hangs should be fatal.
>
> The sysctl now accepts:
> - 0: don't panic (maintains original behavior)
> - 1: panic on first hung task (maintains original behavior)
> - N > 1: panic after N hung tasks are detected in a single scan
>
> This maintains backward compatibility while providing flexibility for
> different hang scenarios.
>
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> Cc: Andrew Jeffery <andrew@...econstruct.com.au>
> Cc: Anshuman Khandual <anshuman.khandual@....com>
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Florian Wesphal <fw@...len.de>
> Cc: Jakub Kacinski <kuba@...nel.org>
> Cc: Jason A. Donenfeld <jason@...c4.com>
> Cc: Joel Granados <joel.granados@...nel.org>
> Cc: Joel Stanley <joel@....id.au>
> Cc: Jonathan Corbet <corbet@....net>
> Cc: Kees Cook <kees@...nel.org>
> Cc: Lance Yang <lance.yang@...ux.dev>
> Cc: Liam Howlett <liam.howlett@...cle.com>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> Cc: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
> Cc: "Paul E . McKenney" <paulmck@...nel.org>
> Cc: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
> Cc: Petr Mladek <pmladek@...e.com>
> Cc: Phil Auld <pauld@...hat.com>
> Cc: Randy Dunlap <rdunlap@...radead.org>
> Cc: Russell King <linux@...linux.org.uk>
> Cc: Shuah Khan <shuah@...nel.org>
> Cc: Simon Horman <horms@...nel.org>
> Cc: Stanislav Fomichev <sdf@...ichev.me>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> ---
So:
Reviewed-by: Lance Yang <lance.yang@...ux.dev>
Tested-by: Lance Yang <lance.yang@...ux.dev>
Cheers,
Lance
Powered by blists - more mailing lists