Skip to content

Commit 1409f14

Browse files
Hillf Dantontorvalds
authored andcommitted
kernel/watchdog.c: disable nmi perf event in the error path of enabling watchdog
In corner cases where softlockup watchdog is not setup successfully, the relevant nmi perf event for hardlockup watchdog could be disabled, then the status of the underlying hardware remains unchanged. Also, if the kthread doesn't start then the hrtimer won't run and the hardlockup detector will falsely fire. Signed-off-by: Hillf Danton <[email protected]> Signed-off-by: Don Zickus <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 534e3ad commit 1409f14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/watchdog.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,12 @@ static int watchdog_enable(int cpu)
430430
p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu);
431431
if (IS_ERR(p)) {
432432
printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu);
433-
if (!err)
433+
if (!err) {
434434
/* if hardlockup hasn't already set this */
435435
err = PTR_ERR(p);
436+
/* and disable the perf event */
437+
watchdog_nmi_disable(cpu);
438+
}
436439
goto out;
437440
}
438441
kthread_bind(p, cpu);

0 commit comments

Comments
 (0)