Skip to content

Commit 8b793bc

Browse files
kmjohansenmcgrof
authored andcommitted
watchdog: move softlockup_panic back to early_param
Setting softlockup_panic from do_sysctl_args() causes it to take effect later in boot. The lockup detector is enabled before SMP is brought online, but do_sysctl_args runs afterwards. If a user wants to set softlockup_panic on boot and have it trigger should a softlockup occur during onlining of the non-boot processors, they could do this prior to commit f117955 ("kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases"). However, after this commit the value of softlockup_panic is set too late to be of help for this type of problem. Restore the prior behavior. Signed-off-by: Krister Johansen <[email protected]> Cc: [email protected] Fixes: f117955 ("kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases") Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 8001f49 commit 8b793bc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fs/proc/proc_sysctl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,6 @@ static const struct sysctl_alias sysctl_aliases[] = {
15761576
{"hung_task_panic", "kernel.hung_task_panic" },
15771577
{"numa_zonelist_order", "vm.numa_zonelist_order" },
15781578
{"softlockup_all_cpu_backtrace", "kernel.softlockup_all_cpu_backtrace" },
1579-
{"softlockup_panic", "kernel.softlockup_panic" },
15801579
{ }
15811580
};
15821581

kernel/watchdog.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer);
283283
static DEFINE_PER_CPU(bool, softlockup_touch_sync);
284284
static unsigned long soft_lockup_nmi_warn;
285285

286+
static int __init softlockup_panic_setup(char *str)
287+
{
288+
softlockup_panic = simple_strtoul(str, NULL, 0);
289+
return 1;
290+
}
291+
__setup("softlockup_panic=", softlockup_panic_setup);
292+
286293
static int __init nowatchdog_setup(char *str)
287294
{
288295
watchdog_user_enabled = 0;

0 commit comments

Comments
 (0)