diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2019-03-26 22:51:02 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-03 06:26:29 +0200 |
commit | 336f6b23b5b842df367b2e78879a7605dd5c180c (patch) | |
tree | 9dbdae54a501b141bf73e841b4305cf319aa8581 | |
parent | c91d07ad34d76dfe65de02a87aced707c0a27da0 (diff) | |
download | linux-rpi3-336f6b23b5b842df367b2e78879a7605dd5c180c.tar.gz linux-rpi3-336f6b23b5b842df367b2e78879a7605dd5c180c.tar.bz2 linux-rpi3-336f6b23b5b842df367b2e78879a7605dd5c180c.zip |
watchdog: Respect watchdog cpumask on CPU hotplug
commit 7dd47617114921fdd8c095509e5e7b4373cc44a1 upstream.
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: 9cf57731b63e ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/watchdog.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 977918d5d350..bbc4940f21af 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -547,13 +547,15 @@ static void softlockup_start_all(void) int lockup_detector_online_cpu(unsigned int cpu) { - watchdog_enable(cpu); + if (cpumask_test_cpu(cpu, &watchdog_allowed_mask)) + watchdog_enable(cpu); return 0; } int lockup_detector_offline_cpu(unsigned int cpu) { - watchdog_disable(cpu); + if (cpumask_test_cpu(cpu, &watchdog_allowed_mask)) + watchdog_disable(cpu); return 0; } |