Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158344
b: refs/heads/master
c: a8af724
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 21, 2009
1 parent 9a552f8 commit f8edffd
Show file tree
Hide file tree
Showing 2 changed files with 11 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: cde7e5ca4e329a157108769d1f752d191cbb71c6
refs/heads/master: a8af7246c114bfd939e539f9566b872c06f6225c
23 changes: 10 additions & 13 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,8 @@ static void __set_se_shares(struct sched_entity *se, unsigned long shares);
*/
static void
update_group_shares_cpu(struct task_group *tg, int cpu,
unsigned long sd_shares, unsigned long sd_rq_weight)
unsigned long sd_shares, unsigned long sd_rq_weight,
unsigned long sd_eff_weight)
{
unsigned long rq_weight;
unsigned long shares;
Expand All @@ -1535,13 +1536,15 @@ update_group_shares_cpu(struct task_group *tg, int cpu,
if (!rq_weight) {
boost = 1;
rq_weight = NICE_0_LOAD;
if (sd_rq_weight == sd_eff_weight)
sd_eff_weight += NICE_0_LOAD;
sd_rq_weight = sd_eff_weight;
}

/*
* \Sum shares * rq_weight
* shares = -----------------------
* \Sum rq_weight
*
* \Sum_j shares_j * rq_weight_i
* shares_i = -----------------------------
* \Sum_j rq_weight_j
*/
shares = (sd_shares * rq_weight) / sd_rq_weight;
shares = clamp_t(unsigned long, shares, MIN_SHARES, MAX_SHARES);
Expand Down Expand Up @@ -1593,14 +1596,8 @@ static int tg_shares_up(struct task_group *tg, void *data)
if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE))
shares = tg->shares;

for_each_cpu(i, sched_domain_span(sd)) {
unsigned long sd_rq_weight = rq_weight;

if (!tg->cfs_rq[i]->rq_weight)
sd_rq_weight = eff_weight;

update_group_shares_cpu(tg, i, shares, sd_rq_weight);
}
for_each_cpu(i, sched_domain_span(sd))
update_group_shares_cpu(tg, i, shares, rq_weight, eff_weight);

return 0;
}
Expand Down

0 comments on commit f8edffd

Please sign in to comment.