Pull scheduler fix from Borislav Petkov: "A single fix to restore fairness between control groups with equal priority" * tag 'sched_urgent_for_v5.13_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Correctly insert cfs_rq's to list on unthrottle
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -3298,6 +3298,24 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags) · 3297 unmodified lines | ||
| 3298 | 3298 | |
| 3299 | 3299 | #ifdef CONFIG_SMP |
| 3300 | 3300 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 3301 | + | |
| 3302 | +static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) | |
| 3303 | +{ | |
| 3304 | + if (cfs_rq->load.weight) | |
| 3305 | + return false; | |
| 3306 | + | |
| 3307 | + if (cfs_rq->avg.load_sum) | |
| 3308 | + return false; | |
| 3309 | + | |
| 3310 | + if (cfs_rq->avg.util_sum) | |
| 3311 | + return false; | |
| 3312 | + | |
| 3313 | + if (cfs_rq->avg.runnable_sum) | |
| 3314 | + return false; | |
| 3315 | + | |
| 3316 | + return true; | |
| 3317 | +} | |
| 3318 | + | |
| 3301 | 3319 | /** |
| 3302 | 3320 | * update_tg_load_avg - update the tg's load avg |
| 3303 | 3321 | * @cfs_rq: the cfs_rq whose avg changed |
| @@ -4091,6 +4109,11 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) · 787 unmodified lines | ||
| 4091 | 4109 | |
| 4092 | 4110 | #else /* CONFIG_SMP */ |
| 4093 | 4111 | |
| 4112 | +static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) | |
| 4113 | +{ | |
| 4114 | + return true; | |
| 4115 | +} | |
| 4116 | + | |
| 4094 | 4117 | #define UPDATE_TG 0x0 |
| 4095 | 4118 | #define SKIP_AGE_LOAD 0x0 |
| 4096 | 4119 | #define DO_ATTACH 0x0 |
| @@ -4749,8 +4772,8 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) · 652 unmodified lines | ||
| 4749 | 4772 | cfs_rq->throttled_clock_task_time += rq_clock_task(rq) - |
| 4750 | 4773 | cfs_rq->throttled_clock_task; |
| 4751 | 4774 | |
| 4752 | − /* Add cfs_rq with already running entity in the list */ | |
| 4753 | − if (cfs_rq->nr_running >= 1) | |
| 4775 | + /* Add cfs_rq with load or one or more already running entities to the list */ | |
| 4776 | + if (!cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running) | |
| 4754 | 4777 | list_add_leaf_cfs_rq(cfs_rq); |
| 4755 | 4778 | } |
| 4756 | 4779 | |
| @@ -7996,23 +8019,6 @@ static bool __update_blocked_others(struct rq *rq, bool *done) · 3239 unmodified lines | ||
| 7996 | 8019 | |
| 7997 | 8020 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| 7998 | 8021 | |
| 7999 | −static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) | |
| 8000 | −{ | |
| 8001 | − if (cfs_rq->load.weight) | |
| 8002 | − return false; | |
| 8003 | − | |
| 8004 | − if (cfs_rq->avg.load_sum) | |
| 8005 | − return false; | |
| 8006 | − | |
| 8007 | − if (cfs_rq->avg.util_sum) | |
| 8008 | − return false; | |
| 8009 | − | |
| 8010 | − if (cfs_rq->avg.runnable_sum) | |
| 8011 | − return false; | |
| 8012 | − | |
| 8013 | − return true; | |
| 8014 | −} | |
| 8015 | − | |
| 8016 | 8022 | static bool __update_blocked_fair(struct rq *rq, bool *done) |
| 8017 | 8023 | { |
| 8018 | 8024 | struct cfs_rq *cfs_rq, *pos; |