| @@ -6876,7 +6876,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · 6875 unmodified lines |
| 6876 | { | 6876 | { |
| 6877 | struct rq *rq = rq_of(cfs_rq); | 6877 | struct rq *rq = rq_of(cfs_rq); |
| 6878 | struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg); | 6878 | struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg); |
| 6879 | struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)]; | 6879 | struct sched_entity *se = cfs_rq_se(cfs_rq); |
| 6880 | | 6880 | |
| 6881 | /* | 6881 | /* |
| 6882 | * It's possible we are called with runtime_remaining < 0 due to things | 6882 | * It's possible we are called with runtime_remaining < 0 due to things |
| @@ -11102,7 +11102,6 @@ static bool __update_blocked_fair(struct rq *rq, bool *done) · 4219 unmodified lines |
| 11102 | { | 11102 | { |
| 11103 | struct cfs_rq *cfs_rq, *pos; | 11103 | struct cfs_rq *cfs_rq, *pos; |
| 11104 | bool decayed = false; | 11104 | bool decayed = false; |
| 11105 | int cpu = cpu_of(rq); | | |
| 11106 | | 11105 | |
| 11107 | /* | 11106 | /* |
| 11108 | * Iterates the task_group tree in a bottom up fashion, see | 11107 | * Iterates the task_group tree in a bottom up fashion, see |
| @@ -11122,7 +11121,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done) · 13 unmodified lines |
| 11122 | } | 11121 | } |
| 11123 | | 11122 | |
| 11124 | /* Propagate pending load changes to the parent, if any: */ | 11123 | /* Propagate pending load changes to the parent, if any: */ |
| 11125 | se = cfs_rq->tg->se[cpu]; | 11124 | se = cfs_rq_se(cfs_rq); |
| 11126 | if (se && !skip_blocked_update(se)) | 11125 | if (se && !skip_blocked_update(se)) |
| 11127 | update_load_avg(cfs_rq_of(se), se, UPDATE_TG); | 11126 | update_load_avg(cfs_rq_of(se), se, UPDATE_TG); |
| 11128 | | 11127 | |
| @@ -11148,8 +11147,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done) · 19 unmodified lines |
| 11148 | */ | 11147 | */ |
| 11149 | static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq) | 11148 | static void update_cfs_rq_h_load(struct cfs_rq *cfs_rq) |
| 11150 | { | 11149 | { |
| 11151 | struct rq *rq = rq_of(cfs_rq); | 11150 | struct sched_entity *se = cfs_rq_se(cfs_rq); |
| 11152 | struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)]; | | |
| 11153 | unsigned long now = jiffies; | 11151 | unsigned long now = jiffies; |
| 11154 | unsigned long load; | 11152 | unsigned long load; |
| 11155 | | 11153 | |
| @@ -15086,7 +15084,6 @@ void free_fair_sched_group(struct task_group *tg) · 3930 unmodified lines |
| 15086 | } | 15084 | } |
| 15087 | | 15085 | |
| 15088 | kfree(tg->cfs_rq); | 15086 | kfree(tg->cfs_rq); |
| 15089 | kfree(tg->se); | | |
| 15090 | } | 15087 | } |
| 15091 | | 15088 | |
| 15092 | int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) | 15089 | int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) |
| @@ -15099,9 +15096,6 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) · 6 unmodified lines |
| 15099 | tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids); | 15096 | tg->cfs_rq = kzalloc_objs(cfs_rq, nr_cpu_ids); |
| 15100 | if (!tg->cfs_rq) | 15097 | if (!tg->cfs_rq) |
| 15101 | goto err; | 15098 | goto err; |
| 15102 | tg->se = kzalloc_objs(se, nr_cpu_ids); | | |
| 15103 | if (!tg->se) | | |
| 15104 | goto err; | | |
| 15105 | | 15099 | |
| 15106 | tg->shares = NICE_0_LOAD; | 15100 | tg->shares = NICE_0_LOAD; |
| 15107 | | 15101 | |
| @@ -15116,7 +15110,7 @@ int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent) · 8 unmodified lines |
| 15116 | cfs_rq = &state->cfs_rq; | 15110 | cfs_rq = &state->cfs_rq; |
| 15117 | se = &state->se; | 15111 | se = &state->se; |
| 15118 | init_cfs_rq(cfs_rq); | 15112 | init_cfs_rq(cfs_rq); |
| 15119 | init_tg_cfs_entry(tg, cfs_rq, se, i, parent->se[i]); | 15113 | init_tg_cfs_entry(tg, cfs_rq, se, i, tg_se(parent, i)); |
| 15120 | init_entity_runnable_average(se); | 15114 | init_entity_runnable_average(se); |
| 15121 | } | 15115 | } |
| 15122 | | 15116 | |
| @@ -15135,7 +15129,7 @@ void online_fair_sched_group(struct task_group *tg) · 12 unmodified lines |
| 15135 | | 15129 | |
| 15136 | for_each_possible_cpu(i) { | 15130 | for_each_possible_cpu(i) { |
| 15137 | rq = cpu_rq(i); | 15131 | rq = cpu_rq(i); |
| 15138 | se = tg->se[i]; | 15132 | se = tg_se(tg, i); |
| 15139 | rq_lock_irq(rq, &rf); | 15133 | rq_lock_irq(rq, &rf); |
| 15140 | update_rq_clock(rq); | 15134 | update_rq_clock(rq); |
| 15141 | attach_entity_cfs_rq(se); | 15135 | attach_entity_cfs_rq(se); |
| @@ -15152,7 +15146,7 @@ void unregister_fair_sched_group(struct task_group *tg) · 10 unmodified lines |
| 15152 | | 15146 | |
| 15153 | for_each_possible_cpu(cpu) { | 15147 | for_each_possible_cpu(cpu) { |
| 15154 | struct cfs_rq *cfs_rq = tg->cfs_rq[cpu]; | 15148 | struct cfs_rq *cfs_rq = tg->cfs_rq[cpu]; |
| 15155 | struct sched_entity *se = tg->se[cpu]; | 15149 | struct sched_entity *se = tg_se(tg, cpu); |
| 15156 | struct rq *rq = cpu_rq(cpu); | 15150 | struct rq *rq = cpu_rq(cpu); |
| 15157 | | 15151 | |
| 15158 | if (se) { | 15152 | if (se) { |
| @@ -15189,7 +15183,6 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq, · 30 unmodified lines |
| 15189 | init_cfs_rq_runtime(cfs_rq); | 15183 | init_cfs_rq_runtime(cfs_rq); |
| 15190 | | 15184 | |
| 15191 | tg->cfs_rq[cpu] = cfs_rq; | 15185 | tg->cfs_rq[cpu] = cfs_rq; |
| 15192 | tg->se[cpu] = se; | | |
| 15193 | | 15186 | |
| 15194 | /* se could be NULL for root_task_group */ | 15187 | /* se could be NULL for root_task_group */ |
| 15195 | if (!se) | 15188 | if (!se) |
| @@ -15220,7 +15213,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares) · 24 unmodified lines |
| 15220 | /* | 15213 | /* |
| 15221 | * We can't change the weight of the root cgroup. | 15214 | * We can't change the weight of the root cgroup. |
| 15222 | */ | 15215 | */ |
| 15223 | if (!tg->se[0]) | 15216 | if (is_root_task_group(tg)) |
| 15224 | return -EINVAL; | 15217 | return -EINVAL; |
| 15225 | | 15218 | |
| 15226 | shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES)); | 15219 | shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES)); |
| @@ -15231,7 +15224,7 @@ static int __sched_group_set_shares(struct task_group *tg, unsigned long shares) · 4 unmodified lines |
| 15231 | tg->shares = shares; | 15224 | tg->shares = shares; |
| 15232 | for_each_possible_cpu(i) { | 15225 | for_each_possible_cpu(i) { |
| 15233 | struct rq *rq = cpu_rq(i); | 15226 | struct rq *rq = cpu_rq(i); |
| 15234 | struct sched_entity *se = tg->se[i]; | 15227 | struct sched_entity *se = tg_se(tg, i); |
| 15235 | struct rq_flags rf; | 15228 | struct rq_flags rf; |
| 15236 | | 15229 | |
| 15237 | /* Propagate contribution to hierarchy */ | 15230 | /* Propagate contribution to hierarchy */ |
| @@ -15282,7 +15275,7 @@ int sched_group_set_idle(struct task_group *tg, long idle) · 44 unmodified lines |
| 15282 | | 15275 | |
| 15283 | for_each_possible_cpu(i) { | 15276 | for_each_possible_cpu(i) { |
| 15284 | struct rq *rq = cpu_rq(i); | 15277 | struct rq *rq = cpu_rq(i); |
| 15285 | struct sched_entity *se = tg->se[i]; | 15278 | struct sched_entity *se = tg_se(tg, i); |
| 15286 | struct cfs_rq *grp_cfs_rq = tg->cfs_rq[i]; | 15279 | struct cfs_rq *grp_cfs_rq = tg->cfs_rq[i]; |
| 15287 | bool was_idle = cfs_rq_is_idle(grp_cfs_rq); | 15280 | bool was_idle = cfs_rq_is_idle(grp_cfs_rq); |
| 15288 | long idle_task_delta; | 15281 | long idle_task_delta; |