From: Peter Zijlstra Date: Fri, 24 Aug 2007 18:39:10 +0000 (+0200) Subject: sched: simplify bonus calculation #2 X-Git-Tag: v2.6.23-rc4~17^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea0aa3b23a193d1fc5c982286edecd071af67d94;p=linux-2.6 sched: simplify bonus calculation #2 current code: delta = calc_delta_mine(delta_exec, curr->load.weight, lw); delta = min((u64)delta, cfs_rq->sleeper_bonus); Notice that this calc_delta_mine() line is exactly delta_mine, which gives: delta = min((u64)delta_mine, cfs_rq->sleeper_bonus); Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 5b2d97fcd8..c078f1af72 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -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 = calc_delta_mine(delta_exec, curr->load.weight, lw); - delta = min((u64)delta, cfs_rq->sleeper_bonus); + delta = min((u64)delta_mine, cfs_rq->sleeper_bonus); delta = min(delta, (unsigned long)( (long)sysctl_sched_runtime_limit - curr->wait_runtime)); cfs_rq->sleeper_bonus -= delta;