Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbbHAMqb (ORCPT ); Sat, 1 Aug 2015 08:46:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46120 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbbHAMq3 (ORCPT ); Sat, 1 Aug 2015 08:46:29 -0400 From: Ulrich Obergfell To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, dzickus@redhat.com, atomlin@redhat.com, uobergfe@redhat.com, jolsa@kernel.org, mhocko@suse.cz, eranian@google.com, cmetcalf@ezchip.com, fweisbec@gmail.com Subject: [PATCH 3/4] watchdog: use park/unpark functions in update_watchdog_all_cpus() Date: Sat, 1 Aug 2015 14:49:24 +0200 Message-Id: <1438433365-2979-4-git-send-email-uobergfe@redhat.com> In-Reply-To: <1438433365-2979-1-git-send-email-uobergfe@redhat.com> References: <1438433365-2979-1-git-send-email-uobergfe@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2185 Lines: 71 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 --- kernel/watchdog.c | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 98d44b1..3618e93 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -747,46 +747,10 @@ void watchdog_resume(void) 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) { - int cpu; - - get_online_cpus(); - for_each_watchdog_cpu(cpu) - update_watchdog(cpu); - put_online_cpus(); + watchdog_park_threads(); + watchdog_unpark_threads(); } static int watchdog_enable_all_cpus(void) -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/