aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorUlrich Obergfell <uobergfe@redhat.com>2015-09-04 18:45:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-04 19:54:41 -0400
commitd4bdd0b21c7652a8271f873cc755486b255c1bbd (patch)
treee7bc5013630c373ceb129c08018cd15578faa3ab /kernel/watchdog.c
parent8c073d27d7ad293bf734cc8475689413afadab81 (diff)
watchdog: use park/unpark functions in update_watchdog_all_cpus()
Remove update_watchdog() and restart_watchdog_hrtimer() since these functions are no longer needed. Changes of parameters such as the sample period are honored at the time when the watchdog threads are being unparked. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> Reviewed-by: Aaron Tomlin <atomlin@redhat.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Don Zickus <dzickus@redhat.com> Cc: Ulrich Obergfell <uobergfe@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Stephane Eranian <eranian@google.com> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index e6eb5b697212..eb8f94b50101 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -745,46 +745,10 @@ void watchdog_resume(void)
745 mutex_unlock(&watchdog_proc_mutex); 745 mutex_unlock(&watchdog_proc_mutex);
746} 746}
747 747
748static void restart_watchdog_hrtimer(void *info)
749{
750 struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
751 int ret;
752
753 /*
754 * No need to cancel and restart hrtimer if it is currently executing
755 * because it will reprogram itself with the new period now.
756 * We should never see it unqueued here because we are running per-cpu
757 * with interrupts disabled.
758 */
759 ret = hrtimer_try_to_cancel(hrtimer);
760 if (ret == 1)
761 hrtimer_start(hrtimer, ns_to_ktime(sample_period),
762 HRTIMER_MODE_REL_PINNED);
763}
764
765static void update_watchdog(int cpu)
766{
767 /*
768 * Make sure that perf event counter will adopt to a new
769 * sampling period. Updating the sampling period directly would
770 * be much nicer but we do not have an API for that now so
771 * let's use a big hammer.
772 * Hrtimer will adopt the new period on the next tick but this
773 * might be late already so we have to restart the timer as well.
774 */
775 watchdog_nmi_disable(cpu);
776 smp_call_function_single(cpu, restart_watchdog_hrtimer, NULL, 1);
777 watchdog_nmi_enable(cpu);
778}
779
780static void update_watchdog_all_cpus(void) 748static void update_watchdog_all_cpus(void)
781{ 749{
782 int cpu; 750 watchdog_park_threads();
783 751 watchdog_unpark_threads();
784 get_online_cpus();
785 for_each_watchdog_cpu(cpu)
786 update_watchdog(cpu);
787 put_online_cpus();
788} 752}
789 753
790static int watchdog_enable_all_cpus(void) 754static int watchdog_enable_all_cpus(void)