[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190327151653.GA23811@redhat.com>
Date: Wed, 27 Mar 2019 16:16:53 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, x86@...nel.org,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Don Zickus <dzickus@...hat.com>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Maxime Coquelin <maxime.coquelin@...hat.com>
Subject: Re: [PATCH] watchdog: Respect watchdog cpumask on CPU hotplug
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@...utronix.de>
> Cc: stable@...r.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.
Powered by blists - more mailing lists