sched: optimize update_curr()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 16 Dec 2008 07:45:31 +0000 (08:45 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Dec 2008 08:46:33 +0000 (09:46 +0100)
Impact: micro-optimization

Skip the hard work when there is none.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index 928cd74cff0db3654ce2fc6c17bed61098afcbb5..5ad4440f0fc44798b84417fa56463dd19ad81267 100644 (file)
@@ -492,6 +492,8 @@ static void update_curr(struct cfs_rq *cfs_rq)
         * overflow on 32 bits):
         */
        delta_exec = (unsigned long)(now - curr->exec_start);
+       if (!delta_exec)
+               return;
 
        __update_curr(cfs_rq, curr, delta_exec);
        curr->exec_start = now;