Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760072AbaGSAot (ORCPT ); Fri, 18 Jul 2014 20:44:49 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:39741 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757819AbaGSAoi (ORCPT ); Fri, 18 Jul 2014 20:44:38 -0400 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Ingo Molnar , "Paul E. McKenney" , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Viresh Kumar Subject: [PATCH 07/10] nohz: Enforce timekeeping on CPU 0 Date: Sat, 19 Jul 2014 02:44:18 +0200 Message-Id: <1405730661-9355-8-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1405730661-9355-1-git-send-email-fweisbec@gmail.com> References: <1405730661-9355-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The timekeeper gets initialized to the value of the CPU where the first clockevent device is setup. This works well because the timekeeper can be any online CPU in most configs. Full dynticks has its own requirement though and needs the timekeeper to always be 0. And this requirement seem to accomodate pretty well with the above described boot timekeeper setting because the first clockevent device happens to be initialized, most of the time, on the boot CPU (which should be CPU 0). However there is no mention of such a guarantee anywhere. This assumption might well be defeated on some corner case now or in the future. So lets wipe out the FUD and force tick_do_timer_cpu to CPU 0 on boot when full dynticks is used. This way we can even remove some corner case code that handled scenarios where all clockevent devices were setup on full dynticks CPUs. Cc: Ingo Molnar Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Viresh Kumar Signed-off-by: Frederic Weisbecker --- kernel/time/tick-common.c | 6 +++--- kernel/time/tick-sched.c | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 0a0608e..cb57bce 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -179,10 +179,10 @@ static void tick_setup_device(struct tick_device *td, * this cpu: */ if (tick_do_timer_cpu == TICK_DO_TIMER_BOOT) { - if (!tick_nohz_full_cpu(cpu)) - tick_do_timer_cpu = cpu; + if (tick_nohz_full_enabled()) + tick_do_timer_cpu = TICK_DO_TIMER_DEFAULT; else - tick_do_timer_cpu = TICK_DO_TIMER_NONE; + tick_do_timer_cpu = cpu; tick_next_period = ktime_get(); tick_period = ktime_set(0, NSEC_PER_SEC / HZ); } diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3d63944..2ea2143 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -741,12 +741,6 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) */ if (tick_do_timer_cpu == cpu) return false; - /* - * Boot safety: make sure the timekeeping duty has been - * assigned before entering dyntick-idle mode, - */ - if (tick_do_timer_cpu == TICK_DO_TIMER_NONE) - return false; } return true; -- 1.8.3.1 -- 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/