History

sched/pelt: Remove unused runnable load average

Now that runnable_load_avg is no more used, we can remove it to make space for a new signal.

Vincent Guittot committed 6 years ago

Commit 0dacee11 parent fb86f5b6 files · +43 −171Browse files

Unified · Split

6 files
  1. include/linux/sched.h +1 −4
  2. kernel/sched/core.c +0 −2
  3. kernel/sched/debug.c +0 −8
  4. kernel/sched/fair.c +16 −114
  5. kernel/sched/pelt.c +24 −38
  6. kernel/sched/sched.h +2 −5
include/linux/sched.h+1−4
@@ -357,7 +357,7 @@ struct util_est { · 356 unmodified lines
357357
358358 /*
359359 * The load_avg/util_avg accumulates an infinite geometric series
360− * (see __update_load_avg() in kernel/sched/fair.c).
360+ * (see __update_load_avg_cfs_rq() in kernel/sched/pelt.c).
361361 *
362362 * [load_avg definition]
363363 *
@@ -401,11 +401,9 @@ struct util_est { · 37 unmodified lines
401401 struct sched_avg {
402402 u64 last_update_time;
403403 u64 load_sum;
404− u64 runnable_load_sum;
405404 u32 util_sum;
406405 u32 period_contrib;
407406 unsigned long load_avg;
408− unsigned long runnable_load_avg;
409407 unsigned long util_avg;
410408 struct util_est util_est;
411409 } ____cacheline_aligned;
@@ -449,7 +447,6 @@ struct sched_statistics { · 37 unmodified lines
449447 struct sched_entity {
450448 /* For load-balancing: */
451449 struct load_weight load;
452− unsigned long runnable_weight;
453450 struct rb_node run_node;
454451 struct list_head group_node;
455452 unsigned int on_rq;
kernel/sched/core.c+0−2
@@ -761,7 +761,6 @@ static void set_load_weight(struct task_struct *p, bool update_load) · 760 unmodified lines
761761 if (task_has_idle_policy(p)) {
762762 load->weight = scale_load(WEIGHT_IDLEPRIO);
763763 load->inv_weight = WMULT_IDLEPRIO;
764− p->se.runnable_weight = load->weight;
765764 return;
766765 }
767766
@@ -774,7 +773,6 @@ static void set_load_weight(struct task_struct *p, bool update_load) · 6 unmodified lines
774773 } else {
775774 load->weight = scale_load(sched_prio_to_weight[prio]);
776775 load->inv_weight = sched_prio_to_wmult[prio];
777− p->se.runnable_weight = load->weight;
778776 }
779777 }
780778
kernel/sched/debug.c+0−8
@@ -402,11 +402,9 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group · 401 unmodified lines
402402 }
403403
404404 P(se->load.weight);
405− P(se->runnable_weight);
406405 #ifdef CONFIG_SMP
407406 P(se->avg.load_avg);
408407 P(se->avg.util_avg);
409− P(se->avg.runnable_load_avg);
410408 #endif
411409
412410 #undef PN_SCHEDSTAT
@@ -524,11 +522,8 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) · 111 unmodified lines
524522 SEQ_printf(m, " .%-30s: %d\n", "nr_running", cfs_rq->nr_running);
525523 SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
526524 #ifdef CONFIG_SMP
527− SEQ_printf(m, " .%-30s: %ld\n", "runnable_weight", cfs_rq->runnable_weight);
528525 SEQ_printf(m, " .%-30s: %lu\n", "load_avg",
529526 cfs_rq->avg.load_avg);
530− SEQ_printf(m, " .%-30s: %lu\n", "runnable_load_avg",
531− cfs_rq->avg.runnable_load_avg);
532527 SEQ_printf(m, " .%-30s: %lu\n", "util_avg",
533528 cfs_rq->avg.util_avg);
534529 SEQ_printf(m, " .%-30s: %u\n", "util_est_enqueued",
@@ -947,13 +942,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, · 412 unmodified lines
947942 "nr_involuntary_switches", (long long)p->nivcsw);
948943
949944 P(se.load.weight);
950− P(se.runnable_weight);
951945 #ifdef CONFIG_SMP
952946 P(se.avg.load_sum);
953− P(se.avg.runnable_load_sum);
954947 P(se.avg.util_sum);
955948 P(se.avg.load_avg);
956− P(se.avg.runnable_load_avg);
957949 P(se.avg.util_avg);
958950 P(se.avg.last_update_time);
959951 P(se.avg.util_est.ewma);
kernel/sched/fair.c+16−114
@@ -741,9 +741,7 @@ void init_entity_runnable_average(struct sched_entity *se) · 740 unmodified lines
741741 * nothing has been attached to the task group yet.
742742 */
743743 if (entity_is_task(se))
744− sa->runnable_load_avg = sa->load_avg = scale_load_down(se->load.weight);
745−
746− se->runnable_weight = se->load.weight;
744+ sa->load_avg = scale_load_down(se->load.weight);
747745
748746 /* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */
749747 }
@@ -2898,25 +2896,6 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) · 2148 unmodified lines
28982896 } while (0)
28992897
29002898 #ifdef CONFIG_SMP
2901−static inline void
2902−enqueue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
2903−{
2904− cfs_rq->runnable_weight += se->runnable_weight;
2905−
2906− cfs_rq->avg.runnable_load_avg += se->avg.runnable_load_avg;
2907− cfs_rq->avg.runnable_load_sum += se_runnable(se) * se->avg.runnable_load_sum;
2908−}
2909−
2910−static inline void
2911−dequeue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
2912−{
2913− cfs_rq->runnable_weight -= se->runnable_weight;
2914−
2915− sub_positive(&cfs_rq->avg.runnable_load_avg, se->avg.runnable_load_avg);
2916− sub_positive(&cfs_rq->avg.runnable_load_sum,
2917− se_runnable(se) * se->avg.runnable_load_sum);
2918−}
2919−
29202899 static inline void
29212900 enqueue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
29222901 {
@@ -2932,28 +2911,22 @@ dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) · 9 unmodified lines
29322911 }
29332912 #else
29342913 static inline void
2935−enqueue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { }
2936−static inline void
2937−dequeue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { }
2938−static inline void
29392914 enqueue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { }
29402915 static inline void
29412916 dequeue_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { }
29422917 #endif
29432918
29442919 static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
2945− unsigned long weight, unsigned long runnable)
2920+ unsigned long weight)
29462921 {
29472922 if (se->on_rq) {
29482923 /* commit outstanding execution time */
29492924 if (cfs_rq->curr == se)
29502925 update_curr(cfs_rq);
29512926 account_entity_dequeue(cfs_rq, se);
2952− dequeue_runnable_load_avg(cfs_rq, se);
29532927 }
29542928 dequeue_load_avg(cfs_rq, se);
29552929
2956− se->runnable_weight = runnable;
29572930 update_load_set(&se->load, weight);
29582931
29592932 #ifdef CONFIG_SMP
@@ -2961,16 +2934,13 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, · 1 unmodified line
29612934 u32 divider = LOAD_AVG_MAX - 1024 + se->avg.period_contrib;
29622935
29632936 se->avg.load_avg = div_u64(se_weight(se) * se->avg.load_sum, divider);
2964− se->avg.runnable_load_avg =
2965− div_u64(se_runnable(se) * se->avg.runnable_load_sum, divider);
29662937 } while (0);
29672938 #endif
29682939
29692940 enqueue_load_avg(cfs_rq, se);
2970− if (se->on_rq) {
2941+ if (se->on_rq)
29712942 account_entity_enqueue(cfs_rq, se);
2972− enqueue_runnable_load_avg(cfs_rq, se);
2973− }
2943+
29742944 }
29752945
29762946 void reweight_task(struct task_struct *p, int prio)
@@ -2980,7 +2950,7 @@ void reweight_task(struct task_struct *p, int prio) · 3 unmodified lines
29802950 struct load_weight *load = &se->load;
29812951 unsigned long weight = scale_load(sched_prio_to_weight[prio]);
29822952
2983− reweight_entity(cfs_rq, se, weight, weight);
2953+ reweight_entity(cfs_rq, se, weight);
29842954 load->inv_weight = sched_prio_to_wmult[prio];
29852955 }
29862956
@@ -3092,50 +3062,6 @@ static long calc_group_shares(struct cfs_rq *cfs_rq) · 105 unmodified lines
30923062 */
30933063 return clamp_t(long, shares, MIN_SHARES, tg_shares);
30943064 }
3095−
3096−/*
3097− * This calculates the effective runnable weight for a group entity based on
3098− * the group entity weight calculated above.
3099− *
3100− * Because of the above approximation (2), our group entity weight is
3101− * an load_avg based ratio (3). This means that it includes blocked load and
3102− * does not represent the runnable weight.
3103− *
3104− * Approximate the group entity's runnable weight per ratio from the group
3105− * runqueue:
3106− *
3107− * grq->avg.runnable_load_avg
3108− * ge->runnable_weight = ge->load.weight * -------------------------- (7)
3109− * grq->avg.load_avg
3110− *
3111− * However, analogous to above, since the avg numbers are slow, this leads to
3112− * transients in the from-idle case. Instead we use:
3113− *
3114− * ge->runnable_weight = ge->load.weight *
3115− *
3116− * max(grq->avg.runnable_load_avg, grq->runnable_weight)
3117− * ----------------------------------------------------- (8)
3118− * max(grq->avg.load_avg, grq->load.weight)
3119− *
3120− * Where these max() serve both to use the 'instant' values to fix the slow
3121− * from-idle and avoid the /0 on to-idle, similar to (6).
3122− */
3123−static long calc_group_runnable(struct cfs_rq *cfs_rq, long shares)
3124−{
3125− long runnable, load_avg;
3126−
3127− load_avg = max(cfs_rq->avg.load_avg,
3128− scale_load_down(cfs_rq->load.weight));
3129−
3130− runnable = max(cfs_rq->avg.runnable_load_avg,
3131− scale_load_down(cfs_rq->runnable_weight));
3132−
3133− runnable *= shares;
3134− if (load_avg)
3135− runnable /= load_avg;
3136−
3137− return clamp_t(long, runnable, MIN_SHARES, shares);
3138−}
31393065 #endif /* CONFIG_SMP */
31403066
31413067 static inline int throttled_hierarchy(struct cfs_rq *cfs_rq);
@@ -3147,7 +3073,7 @@ static inline int throttled_hierarchy(struct cfs_rq *cfs_rq); · 5 unmodified lines
31473073 static void update_cfs_group(struct sched_entity *se)
31483074 {
31493075 struct cfs_rq *gcfs_rq = group_cfs_rq(se);
3150− long shares, runnable;
3076+ long shares;
31513077
31523078 if (!gcfs_rq)
31533079 return;
@@ -3156,16 +3082,15 @@ static void update_cfs_group(struct sched_entity *se) · 2 unmodified lines
31563082 return;
31573083
31583084 #ifndef CONFIG_SMP
3159− runnable = shares = READ_ONCE(gcfs_rq->tg->shares);
3085+ shares = READ_ONCE(gcfs_rq->tg->shares);
31603086
31613087 if (likely(se->load.weight == shares))
31623088 return;
31633089 #else
31643090 shares = calc_group_shares(gcfs_rq);
3165− runnable = calc_group_runnable(gcfs_rq, shares);
31663091 #endif
31673092
3168− reweight_entity(cfs_rq_of(se), se, shares, runnable);
3093+ reweight_entity(cfs_rq_of(se), se, shares);
31693094 }
31703095
31713096 #else /* CONFIG_FAIR_GROUP_SCHED */
@@ -3290,11 +3215,11 @@ void set_task_rq_fair(struct sched_entity *se, · 118 unmodified lines
32903215 * _IFF_ we look at the pure running and runnable sums. Because they
32913216 * represent the very same entity, just at different points in the hierarchy.
32923217 *
3293− * Per the above update_tg_cfs_util() is trivial and simply copies the running
3294− * sum over (but still wrong, because the group entity and group rq do not have
3295− * their PELT windows aligned).
3218+ * Per the above update_tg_cfs_util() is trivial * and simply copies the
3219+ * running sum over (but still wrong, because the group entity and group rq do
3220+ * not have their PELT windows aligned).
32963221 *
3297− * However, update_tg_cfs_runnable() is more complex. So we have:
3222+ * However, update_tg_cfs_load() is more complex. So we have:
32983223 *
32993224 * ge->avg.load_avg = ge->load.weight * ge->avg.runnable_avg (2)
33003225 *
@@ -3375,11 +3300,11 @@ update_tg_cfs_util(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq · 74 unmodified lines
33753300 }
33763301
33773302 static inline void
3378−update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
3303+update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
33793304 {
33803305 long delta_avg, running_sum, runnable_sum = gcfs_rq->prop_runnable_sum;
3381− unsigned long runnable_load_avg, load_avg;
3382− u64 runnable_load_sum, load_sum = 0;
3306+ unsigned long load_avg;
3307+ u64 load_sum = 0;
33833308 s64 delta_sum;
33843309
33853310 if (!runnable_sum)
@@ -3427,20 +3352,6 @@ update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cf · 41 unmodified lines
34273352 se->avg.load_avg = load_avg;
34283353 add_positive(&cfs_rq->avg.load_avg, delta_avg);
34293354 add_positive(&cfs_rq->avg.load_sum, delta_sum);
3430−
3431− runnable_load_sum = (s64)se_runnable(se) * runnable_sum;
3432− runnable_load_avg = div_s64(runnable_load_sum, LOAD_AVG_MAX);
3433−
3434− if (se->on_rq) {
3435− delta_sum = runnable_load_sum -
3436− se_weight(se) * se->avg.runnable_load_sum;
3437− delta_avg = runnable_load_avg - se->avg.runnable_load_avg;
3438− add_positive(&cfs_rq->avg.runnable_load_avg, delta_avg);
3439− add_positive(&cfs_rq->avg.runnable_load_sum, delta_sum);
3440− }
3441−
3442− se->avg.runnable_load_sum = runnable_sum;
3443− se->avg.runnable_load_avg = runnable_load_avg;
34443355 }
34453356
34463357 static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum)
@@ -3468,7 +3379,7 @@ static inline int propagate_entity_load_avg(struct sched_entity *se) · 21 unmodified lines
34683379 add_tg_cfs_propagate(cfs_rq, gcfs_rq->prop_runnable_sum);
34693380
34703381 update_tg_cfs_util(cfs_rq, se, gcfs_rq);
3471− update_tg_cfs_runnable(cfs_rq, se, gcfs_rq);
3382+ update_tg_cfs_load(cfs_rq, se, gcfs_rq);
34723383
34733384 trace_pelt_cfs_tp(cfs_rq);
34743385 trace_pelt_se_tp(se);
@@ -3612,8 +3523,6 @@ static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s · 137 unmodified lines
36123523 div_u64(se->avg.load_avg * se->avg.load_sum, se_weight(se));
36133524 }
36143525
3615− se->avg.runnable_load_sum = se->avg.load_sum;
3616−
36173526 enqueue_load_avg(cfs_rq, se);
36183527 cfs_rq->avg.util_avg += se->avg.util_avg;
36193528 cfs_rq->avg.util_sum += se->avg.util_sum;
@@ -4074,14 +3983,12 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) · 454 unmodified lines
40743983 /*
40753984 * When enqueuing a sched_entity, we must:
40763985 * - Update loads to have both entity and cfs_rq synced with now.
4077− * - Add its load to cfs_rq->runnable_avg
40783986 * - For group_entity, update its weight to reflect the new share of
40793987 * its group cfs_rq
40803988 * - Add its new weight to cfs_rq->load.weight
40813989 */
40823990 update_load_avg(cfs_rq, se, UPDATE_TG | DO_ATTACH);
40833991 update_cfs_group(se);
4084− enqueue_runnable_load_avg(cfs_rq, se);
40853992 account_entity_enqueue(cfs_rq, se);
40863993
40873994 if (flags & ENQUEUE_WAKEUP)
@@ -4158,13 +4065,11 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) · 70 unmodified lines
41584065 /*
41594066 * When dequeuing a sched_entity, we must:
41604067 * - Update loads to have both entity and cfs_rq synced with now.
4161− * - Subtract its load from the cfs_rq->runnable_avg.
41624068 * - Subtract its previous weight from cfs_rq->load.weight.
41634069 * - For group entity, update its weight to reflect the new share
41644070 * of its group cfs_rq.
41654071 */
41664072 update_load_avg(cfs_rq, se, UPDATE_TG);
4167− dequeue_runnable_load_avg(cfs_rq, se);
41684073
41694074 update_stats_dequeue(cfs_rq, se, flags);
41704075
@@ -7649,9 +7554,6 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) · 3478 unmodified lines
76497554 if (cfs_rq->avg.util_sum)
76507555 return false;
76517556
7652− if (cfs_rq->avg.runnable_load_sum)
7653− return false;
7654−
76557557 return true;
76567558 }
76577559
kernel/sched/pelt.c+24−38
@@ -108,7 +108,7 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3) · 107 unmodified lines
108108 */
109109 static __always_inline u32
110110 accumulate_sum(u64 delta, struct sched_avg *sa,
111− unsigned long load, unsigned long runnable, int running)
111+ unsigned long load, int running)
112112 {
113113 u32 contrib = (u32)delta; /* p == 0 -> delta < 1024 */
114114 u64 periods;
@@ -121,8 +121,6 @@ accumulate_sum(u64 delta, struct sched_avg *sa, · 6 unmodified lines
121121 */
122122 if (periods) {
123123 sa->load_sum = decay_load(sa->load_sum, periods);
124− sa->runnable_load_sum =
125− decay_load(sa->runnable_load_sum, periods);
126124 sa->util_sum = decay_load((u64)(sa->util_sum), periods);
127125
128126 /*
@@ -148,8 +146,6 @@ accumulate_sum(u64 delta, struct sched_avg *sa, · 19 unmodified lines
148146
149147 if (load)
150148 sa->load_sum += load * contrib;
151− if (runnable)
152− sa->runnable_load_sum += runnable * contrib;
153149 if (running)
154150 sa->util_sum += contrib << SCHED_CAPACITY_SHIFT;
155151
@@ -186,7 +182,7 @@ accumulate_sum(u64 delta, struct sched_avg *sa, · 30 unmodified lines
186182 */
187183 static __always_inline int
188184 ___update_load_sum(u64 now, struct sched_avg *sa,
189− unsigned long load, unsigned long runnable, int running)
185+ unsigned long load, int running)
190186 {
191187 u64 delta;
192188
@@ -222,7 +218,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa, · 29 unmodified lines
222218 * Also see the comment in accumulate_sum().
223219 */
224220 if (!load)
225− runnable = running = 0;
221+ running = 0;
226222
227223 /*
228224 * Now we know we crossed measurement unit boundaries. The *_avg
@@ -231,14 +227,14 @@ ___update_load_sum(u64 now, struct sched_avg *sa, · 2 unmodified lines
231227 * Step 1: accumulate *_sum since last_update_time. If we haven't
232228 * crossed period boundaries, finish.
233229 */
234− if (!accumulate_sum(delta, sa, load, runnable, running))
230+ if (!accumulate_sum(delta, sa, load, running))
235231 return 0;
236232
237233 return 1;
238234 }
239235
240236 static __always_inline void
241−___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runnable)
237+___update_load_avg(struct sched_avg *sa, unsigned long load)
242238 {
243239 u32 divider = LOAD_AVG_MAX - 1024 + sa->period_contrib;
244240
@@ -246,7 +242,6 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runna · 1 unmodified line
246242 * Step 2: update *_avg.
247243 */
248244 sa->load_avg = div_u64(load * sa->load_sum, divider);
249− sa->runnable_load_avg = div_u64(runnable * sa->runnable_load_sum, divider);
250245 WRITE_ONCE(sa->util_avg, sa->util_sum / divider);
251246 }
252247
@@ -254,17 +249,13 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runna · 1 unmodified line
254249 * sched_entity:
255250 *
256251 * task:
257− * se_runnable() == se_weight()
252+ * se_weight() = se->load.weight
258253 *
259254 * group: [ see update_cfs_group() ]
260255 * se_weight() = tg->weight * grq->load_avg / tg->load_avg
261− * se_runnable() = se_weight(se) * grq->runnable_load_avg / grq->load_avg
262256 *
263− * load_sum := runnable_sum
264− * load_avg = se_weight(se) * runnable_avg
265− *
266− * runnable_load_sum := runnable_sum
267− * runnable_load_avg = se_runnable(se) * runnable_avg
257+ * load_sum := runnable
258+ * load_avg = se_weight(se) * load_sum
268259 *
269260 * XXX collapse load_sum and runnable_load_sum
270261 *
@@ -272,15 +263,12 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runna · 1 unmodified line
272263 *
273264 * load_sum = \Sum se_weight(se) * se->avg.load_sum
274265 * load_avg = \Sum se->avg.load_avg
275− *
276− * runnable_load_sum = \Sum se_runnable(se) * se->avg.runnable_load_sum
277− * runnable_load_avg = \Sum se->avg.runable_load_avg
278266 */
279267
280268 int __update_load_avg_blocked_se(u64 now, struct sched_entity *se)
281269 {
282− if (___update_load_sum(now, &se->avg, 0, 0, 0)) {
283− ___update_load_avg(&se->avg, se_weight(se), se_runnable(se));
270+ if (___update_load_sum(now, &se->avg, 0, 0)) {
271+ ___update_load_avg(&se->avg, se_weight(se));
284272 trace_pelt_se_tp(se);
285273 return 1;
286274 }
@@ -290,10 +278,9 @@ int __update_load_avg_blocked_se(u64 now, struct sched_entity *se) · 3 unmodified lines
290278
291279 int __update_load_avg_se(u64 now, struct cfs_rq *cfs_rq, struct sched_entity *se)
292280 {
293− if (___update_load_sum(now, &se->avg, !!se->on_rq, !!se->on_rq,
294− cfs_rq->curr == se)) {
281+ if (___update_load_sum(now, &se->avg, !!se->on_rq, cfs_rq->curr == se)) {
295282
296− ___update_load_avg(&se->avg, se_weight(se), se_runnable(se));
283+ ___update_load_avg(&se->avg, se_weight(se));
297284 cfs_se_util_change(&se->avg);
298285 trace_pelt_se_tp(se);
299286 return 1;
@@ -306,10 +293,9 @@ int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq) · 6 unmodified lines
306293 {
307294 if (___update_load_sum(now, &cfs_rq->avg,
308295 scale_load_down(cfs_rq->load.weight),
309− scale_load_down(cfs_rq->runnable_weight),
310296 cfs_rq->curr != NULL)) {
311297
312− ___update_load_avg(&cfs_rq->avg, 1, 1);
298+ ___update_load_avg(&cfs_rq->avg, 1);
313299 trace_pelt_cfs_tp(cfs_rq);
314300 return 1;
315301 }
@@ -322,20 +308,19 @@ int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq) · 6 unmodified lines
322308 *
323309 * util_sum = \Sum se->avg.util_sum but se->avg.util_sum is not tracked
324310 * util_sum = cpu_scale * load_sum
325− * runnable_load_sum = load_sum
311+ * runnable_sum = util_sum
326312 *
327− * load_avg and runnable_load_avg are not supported and meaningless.
313+ * load_avg is not supported and meaningless.
328314 *
329315 */
330316
331317 int update_rt_rq_load_avg(u64 now, struct rq *rq, int running)
332318 {
333319 if (___update_load_sum(now, &rq->avg_rt,
334− running,
335320 running,
336321 running)) {
337322
338− ___update_load_avg(&rq->avg_rt, 1, 1);
323+ ___update_load_avg(&rq->avg_rt, 1);
339324 trace_pelt_rt_tp(rq);
340325 return 1;
341326 }
@@ -348,18 +333,19 @@ int update_rt_rq_load_avg(u64 now, struct rq *rq, int running) · 6 unmodified lines
348333 *
349334 * util_sum = \Sum se->avg.util_sum but se->avg.util_sum is not tracked
350335 * util_sum = cpu_scale * load_sum
351− * runnable_load_sum = load_sum
336+ * runnable_sum = util_sum
337+ *
338+ * load_avg is not supported and meaningless.
352339 *
353340 */
354341
355342 int update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
356343 {
357344 if (___update_load_sum(now, &rq->avg_dl,
358− running,
359345 running,
360346 running)) {
361347
362− ___update_load_avg(&rq->avg_dl, 1, 1);
348+ ___update_load_avg(&rq->avg_dl, 1);
363349 trace_pelt_dl_tp(rq);
364350 return 1;
365351 }
@@ -373,7 +359,9 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running) · 7 unmodified lines
373359 *
374360 * util_sum = \Sum se->avg.util_sum but se->avg.util_sum is not tracked
375361 * util_sum = cpu_scale * load_sum
376− * runnable_load_sum = load_sum
362+ * runnable_sum = util_sum
363+ *
364+ * load_avg is not supported and meaningless.
377365 *
378366 */
379367
@@ -401,16 +389,14 @@ int update_irq_load_avg(struct rq *rq, u64 running) · 21 unmodified lines
401389 * rq->clock += delta with delta >= running
402390 */
403391 ret = ___update_load_sum(rq->clock - running, &rq->avg_irq,
404− 0,
405392 0,
406393 0);
407394 ret += ___update_load_sum(rq->clock, &rq->avg_irq,
408− 1,
409395 1,
410396 1);
411397
412398 if (ret) {
413− ___update_load_avg(&rq->avg_irq, 1, 1);
399+ ___update_load_avg(&rq->avg_irq, 1);
414400 trace_pelt_irq_tp(rq);
415401 }
416402
kernel/sched/sched.h+2−5
@@ -489,7 +489,6 @@ struct cfs_bandwidth { }; · 488 unmodified lines
489489 /* CFS-related fields in a runqueue */
490490 struct cfs_rq {
491491 struct load_weight load;
492− unsigned long runnable_weight;
493492 unsigned int nr_running;
494493 unsigned int h_nr_running; /* SCHED_{NORMAL,BATCH,IDLE} */
495494 unsigned int idle_h_nr_running; /* SCHED_IDLE */
@@ -688,8 +687,10 @@ struct dl_rq { · 192 unmodified lines
688687 #ifdef CONFIG_FAIR_GROUP_SCHED
689688 /* An entity is a task if it doesn't "own" a runqueue */
690689 #define entity_is_task(se) (!se->my_q)
690+
691691 #else
692692 #define entity_is_task(se) 1
693+
693694 #endif
694695
695696 #ifdef CONFIG_SMP
@@ -701,10 +702,6 @@ static inline long se_weight(struct sched_entity *se) · 5 unmodified lines
701702 return scale_load_down(se->load.weight);
702703 }
703704
704−static inline long se_runnable(struct sched_entity *se)
705−{
706− return scale_load_down(se->runnable_weight);
707−}
708705
709706 static inline bool sched_asym_prefer(int a, int b)
710707 {