Commit cba5e972 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sched_urgent_for_v5.13_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

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
parents 9df7f15e a7b359fc
...@@ -3298,6 +3298,24 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags) ...@@ -3298,6 +3298,24 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_FAIR_GROUP_SCHED
static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
{
if (cfs_rq->load.weight)
return false;
if (cfs_rq->avg.load_sum)
return false;
if (cfs_rq->avg.util_sum)
return false;
if (cfs_rq->avg.runnable_sum)
return false;
return true;
}
/** /**
* update_tg_load_avg - update the tg's load avg * update_tg_load_avg - update the tg's load avg
* @cfs_rq: the cfs_rq whose avg changed * @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) ...@@ -4091,6 +4109,11 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq)
#else /* CONFIG_SMP */ #else /* CONFIG_SMP */
static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
{
return true;
}
#define UPDATE_TG 0x0 #define UPDATE_TG 0x0
#define SKIP_AGE_LOAD 0x0 #define SKIP_AGE_LOAD 0x0
#define DO_ATTACH 0x0 #define DO_ATTACH 0x0
...@@ -4749,8 +4772,8 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) ...@@ -4749,8 +4772,8 @@ static int tg_unthrottle_up(struct task_group *tg, void *data)
cfs_rq->throttled_clock_task_time += rq_clock_task(rq) - cfs_rq->throttled_clock_task_time += rq_clock_task(rq) -
cfs_rq->throttled_clock_task; cfs_rq->throttled_clock_task;
/* Add cfs_rq with already running entity in the list */ /* Add cfs_rq with load or one or more already running entities to the list */
if (cfs_rq->nr_running >= 1) if (!cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running)
list_add_leaf_cfs_rq(cfs_rq); list_add_leaf_cfs_rq(cfs_rq);
} }
...@@ -7996,23 +8019,6 @@ static bool __update_blocked_others(struct rq *rq, bool *done) ...@@ -7996,23 +8019,6 @@ static bool __update_blocked_others(struct rq *rq, bool *done)
#ifdef CONFIG_FAIR_GROUP_SCHED #ifdef CONFIG_FAIR_GROUP_SCHED
static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
{
if (cfs_rq->load.weight)
return false;
if (cfs_rq->avg.load_sum)
return false;
if (cfs_rq->avg.util_sum)
return false;
if (cfs_rq->avg.runnable_sum)
return false;
return true;
}
static bool __update_blocked_fair(struct rq *rq, bool *done) static bool __update_blocked_fair(struct rq *rq, bool *done)
{ {
struct cfs_rq *cfs_rq, *pos; struct cfs_rq *cfs_rq, *pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment