From: Peter Zijlstra Date: Tue, 16 Dec 2008 07:45:31 +0000 (+0100) Subject: sched: optimize update_curr() X-Git-Tag: v2.6.29-rc1~585^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=34f28ecd0f4bdc733c681294d02d9fab5880591b;p=linux-2.6-omap-h63xx.git sched: optimize update_curr() Impact: micro-optimization Skip the hard work when there is none. Signed-off-by: Peter Zijlstra Acked-by: Mike Galbraith Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 928cd74cff0..5ad4440f0fc 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -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;