Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223990
b: refs/heads/master
c: 67e8625
h: refs/heads/master
v: v3
  • Loading branch information
Paul Turner authored and Ingo Molnar committed Nov 18, 2010
1 parent b463cbd commit 4d2c033
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 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: e33078baa4d30ad1d0e46d1f62b9e5a63a3e6ee3
refs/heads/master: 67e86250f8ea7b8f7da53ac25ea73c6bd71f5cd9
26 changes: 16 additions & 10 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,20 @@ static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
static inline void list_add_leaf_cfs_rq(struct cfs_rq *cfs_rq)
{
if (!cfs_rq->on_list) {
list_add_rcu(&cfs_rq->leaf_cfs_rq_list,
/*
* Ensure we either appear before our parent (if already
* enqueued) or force our parent to appear after us when it is
* enqueued. The fact that we always enqueue bottom-up
* reduces this to two cases.
*/
if (cfs_rq->tg->parent &&
cfs_rq->tg->parent->cfs_rq[cpu_of(rq_of(cfs_rq))]->on_list) {
list_add_rcu(&cfs_rq->leaf_cfs_rq_list,
&rq_of(cfs_rq)->leaf_cfs_rq_list);
} else {
list_add_tail_rcu(&cfs_rq->leaf_cfs_rq_list,
&rq_of(cfs_rq)->leaf_cfs_rq_list);
}

cfs_rq->on_list = 1;
}
Expand Down Expand Up @@ -2016,7 +2028,7 @@ balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest,
/*
* update tg->load_weight by folding this cpu's load_avg
*/
static int tg_shares_up(struct task_group *tg, int cpu)
static int update_shares_cpu(struct task_group *tg, int cpu)
{
struct cfs_rq *cfs_rq;
unsigned long flags;
Expand Down Expand Up @@ -2056,14 +2068,8 @@ static void update_shares(int cpu)
struct rq *rq = cpu_rq(cpu);

rcu_read_lock();
for_each_leaf_cfs_rq(rq, cfs_rq) {
struct task_group *tg = cfs_rq->tg;

do {
tg_shares_up(tg, cpu);
tg = tg->parent;
} while (tg);
}
for_each_leaf_cfs_rq(rq, cfs_rq)
update_shares_cpu(cfs_rq->tg, cpu);
rcu_read_unlock();
}

Expand Down

0 comments on commit 4d2c033

Please sign in to comment.