aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorUlrich Obergfell <uobergfe@redhat.com>2015-04-14 18:43:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:48:58 -0400
commita0c9cbb93da9b9a0e00907a4a5d2e5f1fed86350 (patch)
tree00fb4278d3c4716b9abcd9594fa493958691e069 /kernel
parent84d56e66b9b4a646f04ec30696ca1aeea5e654d5 (diff)
watchdog: introduce the proc_watchdog_update() function
This series introduces a separate handler for each watchdog parameter in /proc/sys/kernel. The separate handlers need a common function that they can call to update the run state of the lockup detectors, or to have the lockup detectors use a new sample period. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/watchdog.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 9a1c78769a33..dcc4990097a2 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -679,6 +679,29 @@ static void watchdog_disable_all_cpus(void)
679} 679}
680 680
681/* 681/*
682 * Update the run state of the lockup detectors.
683 */
684static int proc_watchdog_update(void)
685{
686 int err = 0;
687
688 /*
689 * Watchdog threads won't be started if they are already active.
690 * The 'watchdog_running' variable in watchdog_*_all_cpus() takes
691 * care of this. If those threads are already active, the sample
692 * period will be updated and the lockup detectors will be enabled
693 * or disabled 'on the fly'.
694 */
695 if (watchdog_enabled && watchdog_thresh)
696 err = watchdog_enable_all_cpus(true);
697 else
698 watchdog_disable_all_cpus();
699
700 return err;
701
702}
703
704/*
682 * proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh 705 * proc handler for /proc/sys/kernel/nmi_watchdog,watchdog_thresh
683 */ 706 */
684 707