Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91098
b: refs/heads/master
c: ac884de
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 19, 2008
1 parent 2eb2d93 commit ae3268a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58d6c2d72f8628f39e8689fbde8aa177fcf00a37
refs/heads/master: ac884dec6d4a7df252150af875cffddf8f1d9c15
44 changes: 31 additions & 13 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,29 +362,47 @@ static u64 __sched_period(unsigned long nr_running)
*/
static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
return calc_delta_mine(__sched_period(cfs_rq->nr_running),
se->load.weight, &cfs_rq->load);
u64 slice = __sched_period(cfs_rq->nr_running);

for_each_sched_entity(se) {
cfs_rq = cfs_rq_of(se);

slice *= se->load.weight;
do_div(slice, cfs_rq->load.weight);
}


return slice;
}

/*
* We calculate the vruntime slice.
* We calculate the vruntime slice of a to be inserted task
*
* vs = s/w = p/rw
*/
static u64 __sched_vslice(unsigned long rq_weight, unsigned long nr_running)
static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
u64 vslice = __sched_period(nr_running);
unsigned long nr_running = cfs_rq->nr_running;
unsigned long weight;
u64 vslice;

vslice *= NICE_0_LOAD;
do_div(vslice, rq_weight);
if (!se->on_rq)
nr_running++;

return vslice;
}
vslice = __sched_period(nr_running);

static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
return __sched_vslice(cfs_rq->load.weight + se->load.weight,
cfs_rq->nr_running + 1);
for_each_sched_entity(se) {
cfs_rq = cfs_rq_of(se);

weight = cfs_rq->load.weight;
if (!se->on_rq)
weight += se->load.weight;

vslice *= NICE_0_LOAD;
do_div(vslice, weight);
}

return vslice;
}

/*
Expand Down

0 comments on commit ae3268a

Please sign in to comment.