Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932534AbbKMOWh (ORCPT ); Fri, 13 Nov 2015 09:22:37 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36680 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932438AbbKMOWZ (ORCPT ); Fri, 13 Nov 2015 09:22:25 -0500 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Peter Zijlstra , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , Ingo Molnar , Viresh Kumar , Rik van Riel Subject: [PATCH 7/7] sched-clock: Migrate to use new tick dependency mask model Date: Fri, 13 Nov 2015 15:22:09 +0100 Message-Id: <1447424529-13671-8-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1447424529-13671-1-git-send-email-fweisbec@gmail.com> References: <1447424529-13671-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3020 Lines: 101 Instead of checking sched_clock_stable from the nohz subsystem to verify its tick dependency, migrate it to the new mask in order to include it to the all-in-one check. Cc: Christoph Lameter Cc: Chris Metcalf Cc: Ingo Molnar Cc: Luiz Capitulino Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Viresh Kumar Signed-off-by: Frederic Weisbecker --- kernel/sched/clock.c | 5 +++++ kernel/time/tick-sched.c | 26 ++++++-------------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c index c0a2051..1389e1a 100644 --- a/kernel/sched/clock.c +++ b/kernel/sched/clock.c @@ -61,6 +61,7 @@ #include #include #include +#include /* * Scheduler clock - returns current time in nanosec units. @@ -89,6 +90,8 @@ static void __set_sched_clock_stable(void) { if (!sched_clock_stable()) static_key_slow_inc(&__sched_clock_stable); + + tick_nohz_clear_dep(TICK_CLOCK_UNSTABLE_BIT); } void set_sched_clock_stable(void) @@ -108,6 +111,8 @@ static void __clear_sched_clock_stable(struct work_struct *work) /* XXX worry about clock continuity */ if (sched_clock_stable()) static_key_slow_dec(&__sched_clock_stable); + + tick_nohz_set_dep(TICK_CLOCK_UNSTABLE_BIT); } static DECLARE_WORK(sched_clock_work, __clear_sched_clock_stable); diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 2a1ce82..bc419f84 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -174,8 +174,13 @@ static void trace_tick_dependency(unsigned long dep) return; } - if (dep & TICK_CLOCK_UNSTABLE_MASK) +#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK + if (dep & TICK_CLOCK_UNSTABLE_MASK) { trace_tick_stop(0, "unstable sched clock\n"); + WARN_ONCE(tick_nohz_full_running, + "NO_HZ FULL will not work with unstable sched clock"); + } +#endif } static bool can_stop_full_tick(struct tick_sched *ts) @@ -202,25 +207,6 @@ static bool can_stop_full_tick(struct tick_sched *ts) return false; } -#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK - /* - * sched_clock_tick() needs us? - * - * TODO: kick full dynticks CPUs when - * sched_clock_stable is set. - */ - if (!sched_clock_stable()) { - trace_tick_stop(0, "unstable sched clock\n"); - /* - * Don't allow the user to think they can get - * full NO_HZ with this machine. - */ - WARN_ONCE(tick_nohz_full_running, - "NO_HZ FULL will not work with unstable sched clock"); - return false; - } -#endif - return true; } -- 2.5.3 -- 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/