Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdFQC7p (ORCPT ); Fri, 16 Jun 2017 22:59:45 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36110 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbdFQC7o (ORCPT ); Fri, 16 Jun 2017 22:59:44 -0400 Date: Sat, 17 Jun 2017 12:59:33 +1000 From: Nicholas Piggin To: Andrew Morton Cc: Don Zickus , Babu Moger , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 4/5] watchdog: provide watchdog_reconfigure() for arch watchdogs Message-ID: <20170617125933.774d3858@roar.ozlabs.ibm.com> In-Reply-To: <20170616112407.e150c215209d86d7e8916a47@linux-foundation.org> References: <20170616065715.18390-1-npiggin@gmail.com> <20170616065715.18390-5-npiggin@gmail.com> <20170616112407.e150c215209d86d7e8916a47@linux-foundation.org> Organization: IBM X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2030 Lines: 72 On Fri, 16 Jun 2017 11:24:07 -0700 Andrew Morton wrote: > On Fri, 16 Jun 2017 16:57:14 +1000 Nicholas Piggin wrote: > > > After reconfiguring watchdog sysctls etc., architecture specific > > watchdogs may not get all their parameters updated. > > > > watchdog_reconfigure() can be implemented to pull the new values > > in and set the arch NMI watchdog. > > > > I'll update the title and changelog to say "watchdog_nmi_reconfigure". Thanks. > > --- a/kernel/watchdog.c > > +++ b/kernel/watchdog.c > > @@ -123,6 +123,11 @@ void __weak watchdog_nmi_disable(unsigned int cpu) > > { > > } > > > > +void __weak watchdog_nmi_reconfigure(void) > > +{ > > +} > > Can we please get some documentation in here describing what it's for? > How arch maintainers might use this? When and why it is called, what > it must do? etc. Good point, how's this? --- kernel/watchdog.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 06cd965f64d2..36531025496f 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -114,6 +114,10 @@ int __read_mostly watchdog_suspended; /* * These functions can be overridden if an architecture implements its * own hardlockup detector. + * + * watchdog_nmi_enable/disable can be implemented to start and stop when + * softlockup watchdog threads start and stop. The arch must select the + * SOFTLOCKUP_DETECTOR Kconfig. */ int __weak watchdog_nmi_enable(unsigned int cpu) { @@ -123,6 +127,17 @@ void __weak watchdog_nmi_disable(unsigned int cpu) { } +/* + * watchdog_nmi_reconfigure can be implemented to be notified after any + * watchdog configuration change. The arch hardlockup watchdog should + * respond to the following variables: + * - nmi_watchdog_enabled + * - watchdog_thresh + * - watchdog_cpumask + * - sysctl_hardlockup_all_cpu_backtrace + * - hardlockup_panic + * - watchdog_suspended + */ void __weak watchdog_nmi_reconfigure(void) { } -- 2.11.0