diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-05-26 00:08:59 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-06-06 13:49:02 +0200 |
commit | e40468a54882ef7411fb178dbf2e465ec2349af7 (patch) | |
tree | 5c7859bb5b325752694b3fd0bccbce7b4997dab2 /arch/arm | |
parent | timers: Add accounting of non deferrable timers (diff) | |
download | linux-e40468a54882ef7411fb178dbf2e465ec2349af7.tar.xz linux-e40468a54882ef7411fb178dbf2e465ec2349af7.zip |
timers: Improve get_next_timer_interrupt()
Gilad reported at
http://lkml.kernel.org/r/1336056962-10465-2-git-send-email-gilad@benyossef.com
"Current timer code fails to correctly return a value meaning that
there is no future timer event, with the result that the timer keeps
getting re-armed in HZ one shot mode even when we could turn it off,
generating unneeded interrupts.
What is happening is that when __next_timer_interrupt() wishes
to return a value that signifies "there is no future timer
event", it returns (base->timer_jiffies + NEXT_TIMER_MAX_DELTA).
However, the code in tick_nohz_stop_sched_tick(), which called
__next_timer_interrupt() via get_next_timer_interrupt(),
compares the return value to (last_jiffies + NEXT_TIMER_MAX_DELTA)
to see if the timer needs to be re-armed.
base->timer_jiffies != last_jiffies and so tick_nohz_stop_sched_tick()
interperts the return value as indication that there is a distant
future event 12 days from now and programs the timer to fire next
after KTIME_MAX nsecs instead of avoiding to arm it. This ends up
causing a needless interrupt once every KTIME_MAX nsecs."
Fix this by using the new active timer accounting. This avoids scans
when no active timer is enqueued completely, so we don't have to rely
on base->timer_next and base->timer_jiffies anymore.
Reported-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20120525214819.317535385@linutronix.de
Diffstat (limited to 'arch/arm')
0 files changed, 0 insertions, 0 deletions