nohz: reduce jiffies polling overhead
authorIngo Molnar <mingo@elte.hu>
Mon, 12 May 2008 13:43:53 +0000 (15:43 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 30 May 2008 12:16:10 +0000 (14:16 +0200)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/time/tick-sched.c

index b854a895591efe4f1d40f522d079fe1de0cf256e..cb75394ed00eb753c2ac822b608095dd7efc228d 100644 (file)
@@ -48,6 +48,13 @@ static void tick_do_update_jiffies64(ktime_t now)
        unsigned long ticks = 0;
        ktime_t delta;
 
+       /*
+        * Do a quick check without holding xtime_lock:
+        */
+       delta = ktime_sub(now, last_jiffies_update);
+       if (delta.tv64 < tick_period.tv64)
+               return;
+
        /* Reevalute with xtime_lock held */
        write_seqlock(&xtime_lock);