Skip to content

Commit 7dd4761

Browse files
committed
watchdog: Respect watchdog cpumask on CPU hotplug
The rework of the watchdog core to use cpu_stop_work broke the watchdog cpumask on CPU hotplug. The watchdog_enable/disable() functions are now called unconditionally from the hotplug callback, i.e. even on CPUs which are not in the watchdog cpumask. As a consequence the watchdog can become unstoppable. Only invoke them when the plugged CPU is in the watchdog cpumask. Fixes: 9cf5773 ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1903262245490.1789@nanos.tec.linutronix.de
1 parent 056d28d commit 7dd4761

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/watchdog.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,15 @@ static void softlockup_start_all(void)
554554

555555
int lockup_detector_online_cpu(unsigned int cpu)
556556
{
557-
watchdog_enable(cpu);
557+
if (cpumask_test_cpu(cpu, &watchdog_allowed_mask))
558+
watchdog_enable(cpu);
558559
return 0;
559560
}
560561

561562
int lockup_detector_offline_cpu(unsigned int cpu)
562563
{
563-
watchdog_disable(cpu);
564+
if (cpumask_test_cpu(cpu, &watchdog_allowed_mask))
565+
watchdog_disable(cpu);
564566
return 0;
565567
}
566568

0 commit comments

Comments
 (0)