From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbbCaHZK (ORCPT ); Tue, 31 Mar 2015 03:25:10 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:35351 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbbCaHZH (ORCPT ); Tue, 31 Mar 2015 03:25:07 -0400 Date: Tue, 31 Mar 2015 09:25:02 +0200 From: Ingo Molnar To: cmetcalf@ezchip.com Cc: Andrew Morton , Don Zickus , Andrew Jones , chai wen , Ulrich Obergfell , Fabian Frederick , Aaron Tomlin , Ben Zhang , Christoph Lameter , Frederic Weisbecker , Gilad Ben-Yossef , Steven Rostedt , open list Subject: Re: [PATCH] watchdog: nohz: don't run watchdog on nohz_full cores Message-ID: <20150331072502.GA16754@gmail.com> References: <1427741465-15747-1-git-send-email-cmetcalf@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427741465-15747-1-git-send-email-cmetcalf@ezchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * cmetcalf@ezchip.com wrote: > From: Chris Metcalf > > 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 > --- > 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 > #include > #include > +#include > > #include > #include > @@ -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