]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
watchdog: softlockup: panic when lockup duration exceeds N thresholds
authorLi RongQing <lirongqing@baidu.com>
Tue, 16 Dec 2025 07:45:21 +0000 (02:45 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:44:20 +0000 (19:44 -0800)
commite700f5d1560798aacf0e56fdcc70ee2c20bf56ec
treedd3150ba18c28fb686f4520096f51f7f9b41ad25
parentb5bfcc1ffe512c7879cb90befdeabaa43d9f07ca
watchdog: softlockup: panic when lockup duration exceeds N thresholds

The softlockup_panic sysctl is currently a binary option: panic
immediately or never panic on soft lockups.

Panicking on any soft lockup, regardless of duration, can be overly
aggressive for brief stalls that may be caused by legitimate operations.
Conversely, never panicking may allow severe system hangs to persist
undetected.

Extend softlockup_panic to accept an integer threshold, allowing the
kernel to panic only when the normalized lockup duration exceeds N
watchdog threshold periods.  This provides finer-grained control to
distinguish between transient delays and persistent system failures.

The accepted values are:
- 0: Don't panic (unchanged)
- 1: Panic when duration >= 1 * threshold (20s default, original behavior)
- N > 1: Panic when duration >= N * threshold (e.g., 2 = 40s, 3 = 60s.)

The original behavior is preserved for values 0 and 1, maintaining full
backward compatibility while allowing systems to tolerate brief lockups
while still catching severe, persistent hangs.

[lirongqing@baidu.com: v2]
Link: https://lkml.kernel.org/r/20251218074300.4080-1-lirongqing@baidu.com
Link: https://lkml.kernel.org/r/20251216074521.2796-1-lirongqing@baidu.com
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Song Liu <song@kernel.org>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 files changed:
Documentation/admin-guide/kernel-parameters.txt
arch/arm/configs/aspeed_g5_defconfig
arch/arm/configs/pxa3xx_defconfig
arch/openrisc/configs/or1klitex_defconfig
arch/powerpc/configs/skiroot_defconfig
drivers/gpu/drm/ci/arm.config
drivers/gpu/drm/ci/arm64.config
drivers/gpu/drm/ci/x86_64.config
kernel/configs/debug.config
kernel/watchdog.c
lib/Kconfig.debug
tools/testing/selftests/bpf/config
tools/testing/selftests/wireguard/qemu/kernel.config