linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: Respect watchdog cpumask on CPU hotplug
@ 2019-03-26 21:51 Thomas Gleixner
  2019-03-27 15:16 ` Oleg Nesterov
  2019-03-28 12:37 ` [tip:core/urgent] " tip-bot for Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Gleixner @ 2019-03-26 21:51 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, x86, Oleg Nesterov, Michael Ellerman,
	Nicholas Piggin, Don Zickus, Ricardo Neri

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.

Only invoke them when the plugged CPU is in the watchdog cpumask.

Fixes: 9cf57731b63e ("watchdog/softlockup: Replace "watchdog/%u" threads with cpu_stop_work")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
---
 kernel/watchdog.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- 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;
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-28 12:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 21:51 [PATCH] watchdog: Respect watchdog cpumask on CPU hotplug Thomas Gleixner
2019-03-27 15:16 ` Oleg Nesterov
2019-03-27 19:10   ` Thomas Gleixner
2019-03-28  9:36     ` Maxime Coquelin
2019-03-28 12:37 ` [tip:core/urgent] " tip-bot for Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).