[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160407165835.GD9188@linaro.org>
Date: Thu, 7 Apr 2016 17:58:35 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Chris Metcalf <cmetcalf@...lanox.com>
Cc: Gilad Ben Yossef <giladb@...hip.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>, Tejun Heo <tj@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Christoph Lameter <cl@...ux.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Andy Lutomirski <luto@...capital.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v12 09/13] arm, tile: turn off timer tick for
oneshot_stopped state
On Tue, Apr 05, 2016 at 01:38:38PM -0400, Chris Metcalf wrote:
> When the schedule tick is disabled in tick_nohz_stop_sched_tick(),
> we call hrtimer_cancel(), which eventually calls down into
> __remove_hrtimer() and thus into hrtimer_force_reprogram().
> That function's call to tick_program_event() detects that
> we are trying to set the expiration to KTIME_MAX and calls
> clockevents_switch_state() to set the state to ONESHOT_STOPPED,
> and returns. See commit 8fff52fd5093 ("clockevents: Introduce
> CLOCK_EVT_STATE_ONESHOT_STOPPED state") for more background.
>
> However, by default the internal __clockevents_switch_state() code
> doesn't have a "set_state_oneshot_stopped" function pointer for
> the arm_arch_timer or tile clock_event_device structures, so that
> code returns -ENOSYS, and we end up not setting the state, and more
> importantly, we don't actually turn off the hardware timer.
> As a result, the timer tick we were waiting for before is still
> queued, and fires shortly afterwards, only to discover there was
> nothing for it to do, at which point it quiesces.
>
> The fix is to provide that function pointer field, and like the
> other function pointers, have it just turn off the timer interrupt.
> Any call to set a new timer interval will properly re-enable it.
>
> This fix avoids a small performance hiccup for regular applications,
> but for TASK_ISOLATION code, it fixes a potentially serious
> kernel timer interruption to the time-sensitive application.
>
> Signed-off-by: Chris Metcalf <cmetcalf@...lanox.com>
> ---
Acked-by: Daniel Lezcano <daniel.lezcano@...aro.org>
Powered by blists - more mailing lists