]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Avoid updating system time for sub-jiffy interrupts
authorTony Lindgren <tony@atomide.com>
Thu, 7 Dec 2006 22:01:23 +0000 (14:01 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 16 Apr 2007 20:53:49 +0000 (20:53 +0000)
Updating system time and reprogramming timer can cause latency
issues on busy systems with lots of interrupts with constant
updating of time and reprogramming the system timer.

If a non-timer dyntick interrupt happens within a jiffy from
the last interrupt, updating time and reprogramming the timer
is unnecessary as we will get a timer interrupt soon anyways.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/timer32k.c

index 2653106011618b2a2279eb894298b8390ff2c1ed..c37d7b4118392de3085b4947d19e4d1c8fb39fef 100644 (file)
@@ -219,6 +219,17 @@ static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id)
 
 static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
 {
+       unsigned long now;
+
+       now = omap_32k_sync_timer_read();
+
+       /* Don't bother reprogramming timer if last tick was before next
+        * jiffie. We will get another interrupt when previously programmed
+        * timer expires. This cuts down interrupt load quite a bit.
+        */
+       if (now - omap_32k_last_tick < OMAP_32K_TICKS_PER_HZ)
+               return IRQ_HANDLED;
+
        return _omap_32k_timer_interrupt(irq, dev_id);
 }