[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150402133403.GY23123@twins.programming.kicks-ass.net>
Date: Thu, 2 Apr 2015 15:34:03 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
linaro-kernel@...ts.linaro.org, linux-kernel@...r.kernel.org,
Kevin Hilman <khilman@...aro.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 2/3] clockevents: Restart clockevent device before using
it again
On Fri, Mar 27, 2015 at 10:44:28PM +0530, Viresh Kumar wrote:
> Only hrtimer_reprogram() is responsible for programming the clockevent device
> for next event, if the clockevent device is stopped earlier. And updating that
> alone is sufficient here.
> +++ b/kernel/time/hrtimer.c
> @@ -566,6 +566,7 @@ static int hrtimer_reprogram(struct hrtimer *timer,
> {
> struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
> ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
> + struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
> int res;
>
> WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0);
> @@ -610,6 +611,10 @@ static int hrtimer_reprogram(struct hrtimer *timer,
> if (cpu_base->hang_detected)
> return 0;
>
> + /* Switchback to ONESHOT state */
> + if (unlikely(dev->state == CLOCK_EVT_STATE_ONESHOT_STOPPED))
> + clockevents_set_state(dev, CLOCK_EVT_STATE_ONESHOT);
> +
> /*
> * Clockevents returns -ETIME, when the event was in the past.
> */
Should we not do this in tick_program_event() instead? Note that there
are a few more places that call that, the two in the hrtimer_interrupt()
should be safe because if we're handling the interrupt its cannot be
stopped anyhow.
hrtimer_force_reprogram() seems to need the annotation regardless.
Furthermore, by putting it in tick_program_event() you also don't need
to fixup tick_nohz_restart().
Or am I completely missing something?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists