[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150331072502.GA16754@gmail.com>
Date: Tue, 31 Mar 2015 09:25:02 +0200
From: Ingo Molnar <mingo@...nel.org>
To: cmetcalf@...hip.com
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Don Zickus <dzickus@...hat.com>,
Andrew Jones <drjones@...hat.com>,
chai wen <chaiw.fnst@...fujitsu.com>,
Ulrich Obergfell <uobergfe@...hat.com>,
Fabian Frederick <fabf@...net.be>,
Aaron Tomlin <atomlin@...hat.com>,
Ben Zhang <benzh@...omium.org>,
Christoph Lameter <cl@...ux.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Gilad Ben-Yossef <gilad@...yossef.com>,
Steven Rostedt <rostedt@...dmis.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] watchdog: nohz: don't run watchdog on nohz_full cores
* cmetcalf@...hip.com <cmetcalf@...hip.com> wrote:
> From: Chris Metcalf <cmetcalf@...hip.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@...hip.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);
So what happens if someone wants to enable the lockup detector, with a
long timeout, even on nohz-full CPUs? This patch makes that
impossible.
A better solution would be to tweak the defaults:
- to default the watchdog(s) to disabled when nohz-full is
enabled, even if HARDLOCKUP_DETECTOR=y or DETECT_HUNG_TASK=y, and
allow it to be re-enabled via its sysctl.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists