Subject: sched: tg->weight From: Peter Zijlstra While going through the whole group thing again, I realized tg->shares ought to be called tg->weight, as its the total group weight, and not a share of the group weight. Signed-off-by: Peter Zijlstra --- kernel/sched.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) Index: linux-2.6/kernel/sched.c =================================================================== --- linux-2.6.orig/kernel/sched.c +++ linux-2.6/kernel/sched.c @@ -257,7 +257,7 @@ struct task_group { struct sched_entity **se; /* runqueue "owned" by this group on each cpu */ struct cfs_rq **cfs_rq; - unsigned long shares; + unsigned long weight; #endif #ifdef CONFIG_RT_GROUP_SCHED @@ -1550,11 +1550,11 @@ tg_shares_up(struct task_group *tg, int shares += tg->cfs_rq[i]->shares; } - if ((!shares && rq_weight) || shares > tg->shares) - shares = tg->shares; + if ((!shares && rq_weight) || shares > tg->weight) + shares = tg->weight; if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE)) - shares = tg->shares; + shares = tg->weight; if (!rq_weight) rq_weight = cpus_weight(sd->span) * NICE_0_LOAD; @@ -7802,7 +7802,7 @@ static void init_tg_cfs_entry(struct tas se->cfs_rq = parent->my_q; se->my_q = cfs_rq; - se->load.weight = tg->shares; + se->load.weight = tg->weight; se->load.inv_weight = 0; se->parent = parent; } @@ -7928,7 +7928,7 @@ void __init sched_init(void) init_cfs_rq(&rq->cfs, rq); init_rt_rq(&rq->rt, rq); #ifdef CONFIG_FAIR_GROUP_SCHED - init_task_group.shares = init_task_group_load; + init_task_group.weight = init_task_group_load; INIT_LIST_HEAD(&rq->leaf_cfs_rq_list); #ifdef CONFIG_CGROUP_SCHED /* @@ -7952,7 +7952,7 @@ void __init sched_init(void) */ init_tg_cfs_entry(&init_task_group, &rq->cfs, NULL, i, 1, NULL); #elif defined CONFIG_USER_SCHED - root_task_group.shares = NICE_0_LOAD; + root_task_group.weight = NICE_0_LOAD; init_tg_cfs_entry(&root_task_group, &rq->cfs, NULL, i, 0, NULL); /* * In case of task-groups formed thr' the user id of tasks, @@ -8200,7 +8200,7 @@ int alloc_fair_sched_group(struct task_g if (!tg->se) goto err; - tg->shares = NICE_0_LOAD; + tg->weight = NICE_0_LOAD; for_each_possible_cpu(i) { rq = cpu_rq(i); @@ -8502,7 +8502,7 @@ int sched_group_set_shares(struct task_g shares = MAX_SHARES; mutex_lock(&shares_mutex); - if (tg->shares == shares) + if (tg->weight == shares) goto done; spin_lock_irqsave(&task_group_lock, flags); @@ -8520,7 +8520,7 @@ int sched_group_set_shares(struct task_g * Now we are free to modify the group's share on each cpu * w/o tripping rebalance_share or load_balance_fair. */ - tg->shares = shares; + tg->weight = shares; for_each_possible_cpu(i) { /* * force a rebalance @@ -8545,7 +8545,7 @@ done: unsigned long sched_group_shares(struct task_group *tg) { - return inv_WLS(tg->shares); + return inv_WLS(tg->weight); } #endif