aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2019-03-26 22:51:02 +0100
committerThomas Gleixner <[email protected]>2019-03-28 13:32:01 +0100
commit7dd47617114921fdd8c095509e5e7b4373cc44a1 (patch)
tree0a3fbd526965725d856df783250e62bbc1f6fa31
parent056d28d135bca0b1d0908990338e00e9dadaf057 (diff)
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: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work") Reported-by: Maxime Coquelin <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Maxime Coquelin <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Don Zickus <[email protected]> Cc: Ricardo Neri <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
-rw-r--r--kernel/watchdog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 403c9bd90413..6a5787233113 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -554,13 +554,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;
}