linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: Sasha Levin <sashal@kernel.org>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	pmladek@suse.com, akpm@linux-foundation.org,
	juri.lelli@redhat.com, pauld@redhat.com, nixiaoming@huawei.com,
	john.ogness@linutronix.de, frederic@kernel.org,
	linux@rasmusvillemoes.dk
Subject: Re: [PATCH AUTOSEL 5.15 14/28] watchdog: export lockup_detector_reconfigure
Date: Tue, 23 Aug 2022 11:34:15 +0200	[thread overview]
Message-ID: <351ecdfe-0ec3-c9c3-0dd7-b35b31b3bdd0@linux.ibm.com> (raw)
In-Reply-To: <20220814162610.2397644-14-sashal@kernel.org>

Le 14/08/2022 à 18:25, Sasha Levin a écrit :
> From: Laurent Dufour <ldufour@linux.ibm.com>
> 
> [ Upstream commit 7c56a8733d0a2a4be2438a7512566e5ce552fccf ]

Hi Sasha,

Thanks for picking this patch.

Do you plan to pick the 2 others patches of this series in the older
kernels, as you did for 5.18 and 5.19 ?

The 2 other patches in this series are:
118b1366930c ("powerpc/pseries/mobility: set NMI watchdog factor during an
LPM")
f5e74e836097 ("powerpc/watchdog: introduce a NMI watchdog's factor")

I'm not sure how well they apply to these older kernels.

Thanks,
Laurent.

> 
> In some circumstances it may be interesting to reconfigure the watchdog
> from inside the kernel.
> 
> On PowerPC, this may helpful before and after a LPAR migration (LPM) is
> initiated, because it implies some latencies, watchdog, and especially NMI
> watchdog is expected to be triggered during this operation. Reconfiguring
> the watchdog with a factor, would prevent it to happen too frequently
> during LPM.
> 
> Rename lockup_detector_reconfigure() as __lockup_detector_reconfigure() and
> create a new function lockup_detector_reconfigure() calling
> __lockup_detector_reconfigure() under the protection of watchdog_mutex.
> 
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
> [mpe: Squash in build fix from Laurent, reported by Sachin]
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Link: https://lore.kernel.org/r/20220713154729.80789-3-ldufour@linux.ibm.com
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  include/linux/nmi.h |  2 ++
>  kernel/watchdog.c   | 21 ++++++++++++++++-----
>  2 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/nmi.h b/include/linux/nmi.h
> index 750c7f395ca9..f700ff2df074 100644
> --- a/include/linux/nmi.h
> +++ b/include/linux/nmi.h
> @@ -122,6 +122,8 @@ int watchdog_nmi_probe(void);
>  int watchdog_nmi_enable(unsigned int cpu);
>  void watchdog_nmi_disable(unsigned int cpu);
>  
> +void lockup_detector_reconfigure(void);
> +
>  /**
>   * touch_nmi_watchdog - restart NMI watchdog timeout.
>   *
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index ad912511a0c0..1cfa269bd448 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -537,7 +537,7 @@ int lockup_detector_offline_cpu(unsigned int cpu)
>  	return 0;
>  }
>  
> -static void lockup_detector_reconfigure(void)
> +static void __lockup_detector_reconfigure(void)
>  {
>  	cpus_read_lock();
>  	watchdog_nmi_stop();
> @@ -557,6 +557,13 @@ static void lockup_detector_reconfigure(void)
>  	__lockup_detector_cleanup();
>  }
>  
> +void lockup_detector_reconfigure(void)
> +{
> +	mutex_lock(&watchdog_mutex);
> +	__lockup_detector_reconfigure();
> +	mutex_unlock(&watchdog_mutex);
> +}
> +
>  /*
>   * Create the watchdog infrastructure and configure the detector(s).
>   */
> @@ -573,13 +580,13 @@ static __init void lockup_detector_setup(void)
>  		return;
>  
>  	mutex_lock(&watchdog_mutex);
> -	lockup_detector_reconfigure();
> +	__lockup_detector_reconfigure();
>  	softlockup_initialized = true;
>  	mutex_unlock(&watchdog_mutex);
>  }
>  
>  #else /* CONFIG_SOFTLOCKUP_DETECTOR */
> -static void lockup_detector_reconfigure(void)
> +static void __lockup_detector_reconfigure(void)
>  {
>  	cpus_read_lock();
>  	watchdog_nmi_stop();
> @@ -587,9 +594,13 @@ static void lockup_detector_reconfigure(void)
>  	watchdog_nmi_start();
>  	cpus_read_unlock();
>  }
> +void lockup_detector_reconfigure(void)
> +{
> +	__lockup_detector_reconfigure();
> +}
>  static inline void lockup_detector_setup(void)
>  {
> -	lockup_detector_reconfigure();
> +	__lockup_detector_reconfigure();
>  }
>  #endif /* !CONFIG_SOFTLOCKUP_DETECTOR */
>  
> @@ -629,7 +640,7 @@ static void proc_watchdog_update(void)
>  {
>  	/* Remove impossible cpus to keep sysctl output clean. */
>  	cpumask_and(&watchdog_cpumask, &watchdog_cpumask, cpu_possible_mask);
> -	lockup_detector_reconfigure();
> +	__lockup_detector_reconfigure();
>  }
>  
>  /*


  reply	other threads:[~2022-08-23 12:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-14 16:25 [PATCH AUTOSEL 5.15 01/28] lib/list_debug.c: Detect uninitialized lists Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 02/28] tty: serial: Fix refcount leak bug in ucc_uart.c Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 03/28] KVM: PPC: Book3S HV: Fix "rm_exit" entry in debugfs timings Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 04/28] vfio: Clear the caps->buf to NULL after free Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 05/28] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 06/28] iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 07/28] modules: Ensure natural alignment for .altinstructions and __bug_table sections Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 08/28] ASoC: rsnd: care default case on rsnd_ssiu_busif_err_irq_ctrl() Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 09/28] riscv: dts: sifive: Add fu540 topology information Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 10/28] riscv: dts: sifive: Add fu740 " Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 11/28] riscv: dts: canaan: Add k210 " Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 12/28] riscv: mmap with PROT_WRITE but no PROT_READ is invalid Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 13/28] RISC-V: Add fast call path of crash_kexec() Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 14/28] watchdog: export lockup_detector_reconfigure Sasha Levin
2022-08-23  9:34   ` Laurent Dufour [this message]
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 15/28] powerpc/32: Set an IBAT covering up to _einittext during init Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 16/28] powerpc/32: Don't always pass -mcpu=powerpc to the compiler Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 17/28] ovl: warn if trusted xattr creation fails Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 18/28] powerpc/ioda/iommu/debugfs: Generate unique debugfs entries Sasha Levin
2022-08-14 16:25 ` [PATCH AUTOSEL 5.15 19/28] ALSA: core: Add async signal helpers Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 20/28] ALSA: timer: Use deferred fasync helper Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 21/28] ALSA: control: " Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 22/28] f2fs: fix to avoid use f2fs_bug_on() in f2fs_new_node_page() Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 23/28] f2fs: fix to do sanity check on segment type in build_sit_entries() Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 24/28] smb3: check xattr value length earlier Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 25/28] powerpc/64: Init jump labels before parse_early_param() Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 26/28] venus: pm_helpers: Fix warning in OPP during probe Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 27/28] video: fbdev: i740fb: Check the argument of i740_calc_vclk() Sasha Levin
2022-08-14 16:26 ` [PATCH AUTOSEL 5.15 28/28] MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0 Sasha Levin

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=351ecdfe-0ec3-c9c3-0dd7-b35b31b3bdd0@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=frederic@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mpe@ellerman.id.au \
    --cc=nixiaoming@huawei.com \
    --cc=pauld@redhat.com \
    --cc=pmladek@suse.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.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).