Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175588
b: refs/heads/master
c: cd8ad40
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 9, 2009
1 parent 146316b commit 8f162da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: fb58bac5c75bfff8bbf7d02071a10a62f32fe28b
refs/heads/master: cd8ad40de36c2fe75f3b731bd70198b385895246
8 changes: 6 additions & 2 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ static void update_group_shares_cpu(struct task_group *tg, int cpu,
*/
static int tg_shares_up(struct task_group *tg, void *data)
{
unsigned long weight, rq_weight = 0, shares = 0;
unsigned long weight, rq_weight = 0, sum_weight = 0, shares = 0;
unsigned long *usd_rq_weight;
struct sched_domain *sd = data;
unsigned long flags;
Expand All @@ -1630,6 +1630,7 @@ static int tg_shares_up(struct task_group *tg, void *data)
weight = tg->cfs_rq[i]->load.weight;
usd_rq_weight[i] = weight;

rq_weight += weight;
/*
* If there are currently no tasks on the cpu pretend there
* is one of average load so that when a new task gets to
Expand All @@ -1638,10 +1639,13 @@ static int tg_shares_up(struct task_group *tg, void *data)
if (!weight)
weight = NICE_0_LOAD;

rq_weight += weight;
sum_weight += weight;
shares += tg->cfs_rq[i]->shares;
}

if (!rq_weight)
rq_weight = sum_weight;

if ((!shares && rq_weight) || shares > tg->shares)
shares = tg->shares;

Expand Down

0 comments on commit 8f162da

Please sign in to comment.