Skip to content

Commit

Permalink
sched: simplify bonus calculation #1
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 24, 2007
1 parent b2133c8 commit a6f2994
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit a6f2994

Please sign in to comment.