Commit d4bdd0b2 authored by Ulrich Obergfell's avatar Ulrich Obergfell Committed by Linus Torvalds

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: default avatarUlrich Obergfell <uobergfe@redhat.com>
Reviewed-by: default avatarAaron 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8c073d27
...@@ -745,46 +745,10 @@ void watchdog_resume(void) ...@@ -745,46 +745,10 @@ void watchdog_resume(void)
mutex_unlock(&watchdog_proc_mutex); mutex_unlock(&watchdog_proc_mutex);
} }
static void restart_watchdog_hrtimer(void *info)
{
struct hrtimer *hrtimer = raw_cpu_ptr(&watchdog_hrtimer);
int ret;
/*
* No need to cancel and restart hrtimer if it is currently executing
* because it will reprogram itself with the new period now.
* We should never see it unqueued here because we are running per-cpu
* with interrupts disabled.
*/
ret = hrtimer_try_to_cancel(hrtimer);
if (ret == 1)
hrtimer_start(hrtimer, ns_to_ktime(sample_period),
HRTIMER_MODE_REL_PINNED);
}
static void update_watchdog(int cpu)
{
/*
* Make sure that perf event counter will adopt to a new
* sampling period. Updating the sampling period directly would
* be much nicer but we do not have an API for that now so
* let's use a big hammer.
* Hrtimer will adopt the new period on the next tick but this
* might be late already so we have to restart the timer as well.
*/
watchdog_nmi_disable(cpu);
smp_call_function_single(cpu, restart_watchdog_hrtimer, NULL, 1);
watchdog_nmi_enable(cpu);
}
static void update_watchdog_all_cpus(void) static void update_watchdog_all_cpus(void)
{ {
int cpu; watchdog_park_threads();
watchdog_unpark_threads();
get_online_cpus();
for_each_watchdog_cpu(cpu)
update_watchdog(cpu);
put_online_cpus();
} }
static int watchdog_enable_all_cpus(void) static int watchdog_enable_all_cpus(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment