diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-03-14 22:17:08 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-03-15 03:02:50 +0100 |
commit | 6a6029b8cefe0ca7e82f27f3904dbedba3de4e06 (patch) | |
tree | a58e0590105f89be306daf01fc83473d7a3e0104 /kernel/sched_fair.c | |
parent | e22ecef1d2658ba54ed7d3fdb5d60829fb434c23 (diff) |
sched: simplify sched_slice()
Use the existing calc_delta_mine() calculation for sched_slice(). This
saves a divide and simplifies the code because we share it with the
other /cfs_rq->load users.
It also improves code size:
text data bss dec hex filename
42659 2740 144 45543 b1e7 sched.o.before
42093 2740 144 44977 afb1 sched.o.after
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 31aa1b9fa762..f2cc59080efa 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -283,12 +283,8 @@ static u64 __sched_period(unsigned long nr_running) */ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) { - u64 slice = __sched_period(cfs_rq->nr_running); - - slice *= se->load.weight; - do_div(slice, cfs_rq->load.weight); - - return slice; + return calc_delta_mine(__sched_period(cfs_rq->nr_running), + se->load.weight, &cfs_rq->load); } /* |