Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afc08b15 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Link: http://lkml.kernel.org/r/20150414203501.943658239@linutronix.de


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c6eb3f70
Loading
Loading
Loading
Loading
+4 −15
Original line number Diff line number Diff line
@@ -696,8 +696,6 @@ 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;
		} else if (!tick_program_event(expires, 0))
			goto out;
@@ -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_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS_PINNED);

#ifdef CONFIG_NO_HZ_COMMON
	if (tick_nohz_enabled) {