lkml.org 
[lkml]   [2015]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] watchdog: nohz: don't run watchdog on nohz_full cores
Date
From: Chris Metcalf <cmetcalf@ezchip.com>

Running watchdog can be a helpful debugging feature on regular
cores, but it's incompatible with nohz_full, since it forces
regular scheduling events. Accordingly, just exit out immediately
from any nohz_full core.

An alternate approach would be to add a flags field or function to
smp_hotplug_thread to control on which cores the percpu threads
are created, but it wasn't clear that much mechanism was useful.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
---
kernel/watchdog.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 3174bf8e3538..8a46d9d8a66f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -19,6 +19,7 @@
#include <linux/sysctl.h>
#include <linux/smpboot.h>
#include <linux/sched/rt.h>
+#include <linux/tick.h>

#include <asm/irq_regs.h>
#include <linux/kvm_para.h>
@@ -431,6 +432,10 @@ static void watchdog_enable(unsigned int cpu)
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer->function = watchdog_timer_fn;

+ /* nohz_full cpus do not do watchdog checking. */
+ if (tick_nohz_full_cpu(cpu))
+ do_exit(0);
+
/* Enable the perf event */
watchdog_nmi_enable(cpu);

--
2.1.2


\
 
 \ /
  Last update: 2015-03-30 21:21    [W:0.308 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site