Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100240
b: refs/heads/master
c: f1d239f
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 27, 2008
1 parent cd9515b commit 1a884cf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 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: 83378269a5fad98f562ebc0f09c349575e6cbfe1
refs/heads/master: f1d239f73200a5803a89e5929fb3abc1596b7589
6 changes: 6 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,11 @@ struct cfs_rq {
* this cpu's part of tg->shares
*/
unsigned long shares;

/*
* load.weight at the time we set shares
*/
unsigned long rq_weight;
#endif
#endif
};
Expand Down Expand Up @@ -1527,6 +1532,7 @@ __update_group_shares_cpu(struct task_group *tg, int cpu,
* record the actual number of shares, not the boosted amount.
*/
tg->cfs_rq[cpu]->shares = boost ? 0 : shares;
tg->cfs_rq[cpu]->rq_weight = rq_weight;

if (shares < MIN_SHARES)
shares = MIN_SHARES;
Expand Down
18 changes: 15 additions & 3 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,22 @@ static inline int wake_idle(int cpu, struct task_struct *p)
static const struct sched_class fair_sched_class;

#ifdef CONFIG_FAIR_GROUP_SCHED
static unsigned long effective_load(struct task_group *tg, int cpu,
unsigned long wl, unsigned long wg)
static long effective_load(struct task_group *tg, int cpu,
long wl, long wg)
{
struct sched_entity *se = tg->se[cpu];
long more_w;

if (!tg->parent)
return wl;

/*
* Instead of using this increment, also add the difference
* between when the shares were last updated and now.
*/
more_w = se->my_q->load.weight - se->my_q->rq_weight;
wl += more_w;
wg += more_w;

for_each_sched_entity(se) {
#define D(n) (likely(n) ? (n) : 1)
Expand All @@ -1086,7 +1098,7 @@ static unsigned long effective_load(struct task_group *tg, int cpu,

S = se->my_q->tg->shares;
s = se->my_q->shares;
rw = se->my_q->load.weight;
rw = se->my_q->rq_weight;

a = S*(rw + wl);
b = S*rw + s*wg;
Expand Down

0 comments on commit 1a884cf

Please sign in to comment.