Merge tag 'sched-urgent-2020-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Thomas Gleixner:
"A set of fixes for the scheduler:

- Fix handling of throttled parents in enqueue_task_fair() completely.

The recent fix overlooked a corner case where the first iteration
terminates due to an entity already being on the runqueue which
makes the list management incomplete and later triggers the
assertion which checks for completeness.

- Fix a similar problem in unthrottle_cfs_rq().

- Show the correct uclamp values in procfs which prints the effective
value twice instead of requested and effective"

* tag 'sched-urgent-2020-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list
sched/debug: Fix requested task uclamp values shown in procfs
sched/fair: Fix enqueue_task_fair() warning some more

Changed files
+40 -15
kernel
sched
+2 -2
kernel/sched/debug.c
··· 948 948 P(se.avg.util_est.enqueued); 949 949 #endif 950 950 #ifdef CONFIG_UCLAMP_TASK 951 - __PS("uclamp.min", p->uclamp[UCLAMP_MIN].value); 952 - __PS("uclamp.max", p->uclamp[UCLAMP_MAX].value); 951 + __PS("uclamp.min", p->uclamp_req[UCLAMP_MIN].value); 952 + __PS("uclamp.max", p->uclamp_req[UCLAMP_MAX].value); 953 953 __PS("effective uclamp.min", uclamp_eff_value(p, UCLAMP_MIN)); 954 954 __PS("effective uclamp.max", uclamp_eff_value(p, UCLAMP_MAX)); 955 955 #endif
+38 -13
kernel/sched/fair.c
··· 4774 4774 struct rq *rq = rq_of(cfs_rq); 4775 4775 struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(cfs_rq->tg); 4776 4776 struct sched_entity *se; 4777 - int enqueue = 1; 4778 4777 long task_delta, idle_task_delta; 4779 4778 4780 4779 se = cfs_rq->tg->se[cpu_of(rq)]; ··· 4797 4798 idle_task_delta = cfs_rq->idle_h_nr_running; 4798 4799 for_each_sched_entity(se) { 4799 4800 if (se->on_rq) 4800 - enqueue = 0; 4801 - 4801 + break; 4802 4802 cfs_rq = cfs_rq_of(se); 4803 - if (enqueue) { 4804 - enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP); 4805 - } else { 4806 - update_load_avg(cfs_rq, se, 0); 4807 - se_update_runnable(se); 4808 - } 4803 + enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP); 4809 4804 4810 4805 cfs_rq->h_nr_running += task_delta; 4811 4806 cfs_rq->idle_h_nr_running += idle_task_delta; 4812 4807 4808 + /* end evaluation on encountering a throttled cfs_rq */ 4813 4809 if (cfs_rq_throttled(cfs_rq)) 4814 - break; 4810 + goto unthrottle_throttle; 4815 4811 } 4816 4812 4817 - if (!se) 4818 - add_nr_running(rq, task_delta); 4813 + for_each_sched_entity(se) { 4814 + cfs_rq = cfs_rq_of(se); 4819 4815 4816 + update_load_avg(cfs_rq, se, UPDATE_TG); 4817 + se_update_runnable(se); 4818 + 4819 + cfs_rq->h_nr_running += task_delta; 4820 + cfs_rq->idle_h_nr_running += idle_task_delta; 4821 + 4822 + 4823 + /* end evaluation on encountering a throttled cfs_rq */ 4824 + if (cfs_rq_throttled(cfs_rq)) 4825 + goto unthrottle_throttle; 4826 + 4827 + /* 4828 + * One parent has been throttled and cfs_rq removed from the 4829 + * list. Add it back to not break the leaf list. 4830 + */ 4831 + if (throttled_hierarchy(cfs_rq)) 4832 + list_add_leaf_cfs_rq(cfs_rq); 4833 + } 4834 + 4835 + /* At this point se is NULL and we are at root level*/ 4836 + add_nr_running(rq, task_delta); 4837 + 4838 + unthrottle_throttle: 4820 4839 /* 4821 4840 * The cfs_rq_throttled() breaks in the above iteration can result in 4822 4841 * incomplete leaf list maintenance, resulting in triggering the ··· 4843 4826 for_each_sched_entity(se) { 4844 4827 cfs_rq = cfs_rq_of(se); 4845 4828 4846 - list_add_leaf_cfs_rq(cfs_rq); 4829 + if (list_add_leaf_cfs_rq(cfs_rq)) 4830 + break; 4847 4831 } 4848 4832 4849 4833 assert_list_leaf_cfs_rq(rq); ··· 5497 5479 /* end evaluation on encountering a throttled cfs_rq */ 5498 5480 if (cfs_rq_throttled(cfs_rq)) 5499 5481 goto enqueue_throttle; 5482 + 5483 + /* 5484 + * One parent has been throttled and cfs_rq removed from the 5485 + * list. Add it back to not break the leaf list. 5486 + */ 5487 + if (throttled_hierarchy(cfs_rq)) 5488 + list_add_leaf_cfs_rq(cfs_rq); 5500 5489 } 5501 5490 5502 5491 enqueue_throttle: