From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966123AbbDVTJ5 (ORCPT ); Wed, 22 Apr 2015 15:09:57 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41405 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932258AbbDVTJy (ORCPT ); Wed, 22 Apr 2015 15:09:54 -0400 Date: Wed, 22 Apr 2015 12:09:21 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, preeti@linux.vnet.ibm.com, peterz@infradead.org, hpa@zytor.com, mtosatti@redhat.com, fweisbec@gmail.com, mingo@kernel.org, john.stultz@linaro.org, linux-kernel@vger.kernel.org, viresh.kumar@linaro.org Reply-To: viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, mingo@kernel.org, john.stultz@linaro.org, peterz@infradead.org, preeti@linux.vnet.ibm.com, hpa@zytor.com, mtosatti@redhat.com, tglx@linutronix.de In-Reply-To: <20150414203501.943658239@linutronix.de> References: <20150414203501.943658239@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] tick: sched: Remove hrtimer_active() checks Git-Commit-ID: afc08b15cc2a3d2c48cbd427be8e0eea05698363 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: afc08b15cc2a3d2c48cbd427be8e0eea05698363 Gitweb: http://git.kernel.org/tip/afc08b15cc2a3d2c48cbd427be8e0eea05698363 Author: Thomas Gleixner AuthorDate: Tue, 14 Apr 2015 21:08:52 +0000 Committer: Thomas Gleixner CommitDate: Wed, 22 Apr 2015 17:06:50 +0200 tick: sched: Remove hrtimer_active() checks hrtimer_start() enforces a timer interrupt if the timer is already expired. Get rid of the checks and the forward loop. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Acked-by: Peter Zijlstra Cc: Preeti U Murthy Cc: Viresh Kumar Cc: Marcelo Tosatti Cc: John Stultz Cc: Marcelo Tosatti Link: http://lkml.kernel.org/r/20150414203501.943658239@linutronix.de Signed-off-by: Thomas Gleixner --- kernel/time/tick-sched.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 9142591..dc586c3 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -696,11 +696,9 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { hrtimer_start(&ts->sched_timer, expires, HRTIMER_MODE_ABS_PINNED); - /* Check, if the timer was already in the past */ - if (hrtimer_active(&ts->sched_timer)) - goto out; + goto out; } else if (!tick_program_event(expires, 0)) - goto out; + goto out; /* * We are past the event already. So we crossed a * jiffie boundary. Update jiffies and raise the @@ -888,8 +886,6 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED); - /* Check, if the timer was already in the past */ - if (hrtimer_active(&ts->sched_timer)) break; } else { if (!tick_program_event( @@ -1167,15 +1163,8 @@ void tick_setup_sched_timer(void) hrtimer_add_expires_ns(&ts->sched_timer, offset); } - for (;;) { - hrtimer_forward(&ts->sched_timer, now, tick_period); - hrtimer_start_expires(&ts->sched_timer, - HRTIMER_MODE_ABS_PINNED); - /* Check, if the timer was already in the past */ - if (hrtimer_active(&ts->sched_timer)) - break; - now = ktime_get(); - } + hrtimer_forward(&ts->sched_timer, now, tick_period); + hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED); #ifdef CONFIG_NO_HZ_COMMON if (tick_nohz_enabled) {