Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646862 > unrolled thread

[PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs

Started byNicholas Piggin <npiggin@gmail.com>
First post2017-05-22 15:10 +0200
Last post2017-05-23 16:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs Nicholas Piggin <npiggin@gmail.com> - 2017-05-22 15:10 +0200
    Re: [PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch  watchdogs kbuild test robot <lkp@intel.com> - 2017-05-23 16:20 +0200

#1646862 — [PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs

FromNicholas Piggin <npiggin@gmail.com>
Date2017-05-22 15:10 +0200
Subject[PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs
Message-ID<tJVfX-68S-11@gated-at.bofh.it>
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.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 kernel/watchdog.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index deb010505646..d2996f5bf551 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -120,6 +120,11 @@ void __weak watchdog_nmi_disable(unsigned int cpu)
 {
 }
 
+void __weak watchdog_nmi_reconfigure(void)
+{
+}
+
+
 #ifdef CONFIG_SOFTLOCKUP_DETECTOR
 
 /* Helper for online, unparked cpus. */
@@ -597,6 +602,12 @@ static void watchdog_disable_all_cpus(void)
 	}
 }
 
+static int watchdog_update_cpus(void)
+{
+	return smpboot_update_cpumask_percpu_thread(
+		    &watchdog_threads, &watchdog_cpumask);
+}
+
 #else /* SOFTLOCKUP */
 static int watchdog_park_threads(void)
 {
@@ -616,6 +627,10 @@ static void watchdog_disable_all_cpus(void)
 {
 }
 
+static int watchdog_update_cpus(void)
+{
+}
+
 static void set_sample_period(void)
 {
 }
@@ -648,6 +663,8 @@ int lockup_detector_suspend(void)
 		watchdog_enabled = 0;
 	}
 
+	watchdog_nmi_reconfigure();
+
 	mutex_unlock(&watchdog_proc_mutex);
 
 	return ret;
@@ -668,6 +685,8 @@ void lockup_detector_resume(void)
 	if (watchdog_running && !watchdog_suspended)
 		watchdog_unpark_threads();
 
+	watchdog_nmi_reconfigure();
+
 	mutex_unlock(&watchdog_proc_mutex);
 	put_online_cpus();
 }
@@ -693,6 +712,8 @@ static int proc_watchdog_update(void)
 	else
 		watchdog_disable_all_cpus();
 
+	watchdog_nmi_reconfigure();
+
 	return err;
 
 }
@@ -878,12 +899,11 @@ int proc_watchdog_cpumask(struct ctl_table *table, int write,
 			 * a temporary cpumask, so we are likely not in a
 			 * position to do much else to make things better.
 			 */
-#ifdef CONFIG_SOFTLOCKUP_DETECTOR
-			if (smpboot_update_cpumask_percpu_thread(
-				    &watchdog_threads, &watchdog_cpumask) != 0)
+			if (watchdog_update_cpus() != 0)
 				pr_err("cpumask update failed\n");
-#endif
 		}
+
+		watchdog_nmi_reconfigure();
 	}
 out:
 	mutex_unlock(&watchdog_proc_mutex);
-- 
2.11.0

[toc] | [next] | [standalone]


#1648114 — Re: [PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs

Fromkbuild test robot <lkp@intel.com>
Date2017-05-23 16:20 +0200
SubjectRe: [PATCH 4/5] watchdog: Provide watchdog_reconfigure() for arch watchdogs
Message-ID<tKiPg-4kM-29@gated-at.bofh.it>
In reply to#1646862

[Multipart message — attachments visible in raw view] — view raw

Hi Nicholas,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.12-rc2 next-20170523]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Nicholas-Piggin/Improve-watchdog-config-for-arch-watchdogs/20170523-200254
config: tile-tilegx_defconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   kernel/watchdog.c: In function 'watchdog_update_cpus':
>> kernel/watchdog.c:632:1: warning: no return statement in function returning non-void [-Wreturn-type]

vim +632 kernel/watchdog.c

   616	
   617	static void watchdog_unpark_threads(void)
   618	{
   619	}
   620	
   621	static int watchdog_enable_all_cpus(void)
   622	{
   623		return 0;
   624	}
   625	
   626	static void watchdog_disable_all_cpus(void)
   627	{
   628	}
   629	
   630	static int watchdog_update_cpus(void)
   631	{
 > 632	}
   633	
   634	static void set_sample_period(void)
   635	{
   636	}
   637	#endif /* SOFTLOCKUP */
   638	
   639	/*
   640	 * Suspend the hard and soft lockup detector by parking the watchdog threads.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web