On Wed, 2025-10-15 at 14:36 +0800, lirongqing wrote: > From: Li RongQing <lirongqing@xxxxxxxxx> > > 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@xxxxxxxxx> > Cc: Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx> > Cc: Anshuman Khandual <anshuman.khandual@xxxxxxx> > Cc: Arnd Bergmann <arnd@xxxxxxxx> > Cc: David Hildenbrand <david@xxxxxxxxxx> > Cc: Florian Wesphal <fw@xxxxxxxxx> > Cc: Jakub Kacinski <kuba@xxxxxxxxxx> > Cc: Jason A. Donenfeld <jason@xxxxxxxxx> > Cc: Joel Granados <joel.granados@xxxxxxxxxx> > Cc: Joel Stanley <joel@xxxxxxxxx> > Cc: Jonathan Corbet <corbet@xxxxxxx> > Cc: Kees Cook <kees@xxxxxxxxxx> > Cc: Lance Yang <lance.yang@xxxxxxxxx> > Cc: Liam Howlett <liam.howlett@xxxxxxxxxx> > Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> > Cc: "Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> > Cc: "Paul E . McKenney" <paulmck@xxxxxxxxxx> > Cc: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx> > Cc: Petr Mladek <pmladek@xxxxxxxx> > Cc: Phil Auld <pauld@xxxxxxxxxx> > Cc: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> > Cc: Russell King <linux@xxxxxxxxxxxxxxx> > Cc: Shuah Khan <shuah@xxxxxxxxxx> > Cc: Simon Horman <horms@xxxxxxxxxx> > Cc: Stanislav Fomichev <sdf@xxxxxxxxxxx> > Cc: Steven Rostedt <rostedt@xxxxxxxxxxx> > --- > diff with v3: comments modification, suggested by Lance, Masami, Randy and Petr > diff with v2: do not add a new sysctl, extend hung_task_panic, suggested by Kees Cook > > Documentation/admin-guide/kernel-parameters.txt | 20 +++++++++++++------- > Documentation/admin-guide/sysctl/kernel.rst | 9 +++++---- > arch/arm/configs/aspeed_g5_defconfig | 2 +- For the aspeed_g5_defconfig change: Acked-by: Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx>
