linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	x86@kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Don Zickus <dzickus@redhat.com>,
	Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: Re: [PATCH] watchdog: Respect watchdog cpumask on CPU hotplug
Date: Wed, 27 Mar 2019 16:16:53 +0100	[thread overview]
Message-ID: <20190327151653.GA23811@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1903262245490.1789@nanos.tec.linutronix.de>

On 03/26, Thomas Gleixner wrote:
>
> 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;
>  }

IIUC without this fix an NMI watchdog can too be enabled at boot time even
if the initial watchdog_cpumask = housekeeping_cpumask(HK_FLAG_TIMER) doesn't
include the plugged CPU.

And after that writing 0 to /proc/sys/kernel/nmi_watchdog clears
NMI_WATCHDOG_ENABLED but this can't disable NMI watchdog's outside of
watchdog_allowed_mask.

So may be this can explain the problem reported by Maxime ?
See https://lore.kernel.org/lkml/b99c5a25-a5fe-18dd-2f1d-bdd6834f03e5@redhat.com/

Oleg.


  reply	other threads:[~2019-03-27 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 21:51 [PATCH] watchdog: Respect watchdog cpumask on CPU hotplug Thomas Gleixner
2019-03-27 15:16 ` Oleg Nesterov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190327151653.GA23811@redhat.com \
    --to=oleg@redhat.com \
    --cc=dzickus@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).