Skip to content

Commit

Permalink
Merge tag 'sched_urgent_for_v5.13_rc6' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
Linus Torvalds committed Jun 20, 2021
2 parents 9df7f15 + a7b359f commit cba5e97
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
@@ -3298,6 +3298,24 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)

#ifdef CONFIG_SMP
#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
* @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)

#else /* CONFIG_SMP */

static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
{
return true;
}

#define UPDATE_TG 0x0
#define SKIP_AGE_LOAD 0x0
#define DO_ATTACH 0x0
@@ -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;

/* Add cfs_rq with already running entity in the list */
if (cfs_rq->nr_running >= 1)
/* Add cfs_rq with load or one or more already running entities to the list */
if (!cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running)
list_add_leaf_cfs_rq(cfs_rq);
}

@@ -7996,23 +8019,6 @@ static bool __update_blocked_others(struct rq *rq, bool *done)

#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)
{
struct cfs_rq *cfs_rq, *pos;

0 comments on commit cba5e97

Please sign in to comment.