]> err.no Git - linux-2.6/commitdiff
sched: simplify bonus calculation #1
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 24 Aug 2007 18:39:10 +0000 (20:39 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 24 Aug 2007 18:39:10 +0000 (20:39 +0200)
current code:

 delta = min(cfs_rq->sleeper_bonus, (u64)delta_exec);
 delta = calc_delta_mine(delta, curr->load.weight, lw);
 delta = min((u64)delta, cfs_rq->sleeper_bonus);

drop the first min(), because we clip against sleeper_bonus in the 3rd line
again. That gives:

 delta = calc_delta_mine(delta_exec, curr->load.weight, lw);
 delta = min((u64)delta, cfs_rq->sleeper_bonus);

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

index c578370cd693fd56635482b622429598d561a761..5b2d97fcd80ca5fa1d4b9eb8601f9b9c1a684992 100644 (file)
@@ -303,8 +303,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr)
        delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw);
 
        if (cfs_rq->sleeper_bonus > sysctl_sched_granularity) {
-               delta = min(cfs_rq->sleeper_bonus, (u64)delta_exec);
-               delta = calc_delta_mine(delta, curr->load.weight, lw);
+               delta = calc_delta_mine(delta_exec, curr->load.weight, lw);
                delta = min((u64)delta, cfs_rq->sleeper_bonus);
                delta = min(delta, (unsigned long)(
                        (long)sysctl_sched_runtime_limit - curr->wait_runtime));