From ca2c5c8844a41fba6a1482d7f687720f900f03fb Mon Sep 17 00:00:00 2001 From: Cruz Zhao Date: Mon, 21 Jun 2021 15:39:34 +0800 Subject: [PATCH 2927/2944] alinux: sched: fix the bug that compile faid without CONFIG_GROUP_IDENTITY fix #34030593 In commit 8711d908e693, cfs_rq->nr_tasks is called without #ifdef CONFIG_GROUP_IDENTITY, which will result in compile failure if CONFIG_GROUP_IDENTITY is off. To fix this problem, we changed the parameters of id_update_make_up(). Fixes: 8711d908e693 ("alinux: sched: make up nr_high/under_running for cfs bandwidth") Signed-off-by: Cruz Zhao Acked-by: Michael Wang --- kernel/sched/fair.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8c3cdb1..3f5123b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -960,15 +960,16 @@ static inline bool is_idle_seeker_task(struct task_struct *p) } static noinline void -id_update_make_up(struct task_group *tg, struct rq *rq, long delta) +id_update_make_up(struct task_group *tg, struct rq *rq, struct cfs_rq *cfs_rq, + int coefficient) { struct sched_entity *se = tg->se[cpu_of(rq)]; if (is_highclass(se)) - rq->nr_high_make_up += delta; + rq->nr_high_make_up += coefficient * cfs_rq->nr_tasks; if (is_underclass(se)) - rq->nr_under_make_up += delta; + rq->nr_under_make_up += coefficient * cfs_rq->nr_tasks; } static noinline void @@ -1763,7 +1764,8 @@ static inline u64 id_vruntime(struct sched_entity *se) } static inline void -id_update_make_up(struct task_group *tg, struct rq *rq, long delta) +id_update_make_up(struct task_group *tg, struct rq *rq, struct cfs_rq *cfs_rq, + int coefficient) { } @@ -5861,7 +5863,7 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) /* Add cfs_rq with already running entity in the list */ if (cfs_rq->nr_running >= 1) list_add_leaf_cfs_rq(cfs_rq); - id_update_make_up(tg, rq, cfs_rq->nr_tasks); + id_update_make_up(tg, rq, cfs_rq, 1); } return 0; @@ -5876,7 +5878,7 @@ static int tg_throttle_down(struct task_group *tg, void *data) if (!cfs_rq->throttle_count) { cfs_rq->throttled_clock_task = rq_clock_task(rq); list_del_leaf_cfs_rq(cfs_rq); - id_update_make_up(tg, rq, -(cfs_rq->nr_tasks)); + id_update_make_up(tg, rq, cfs_rq, -1); } cfs_rq->throttle_count++; -- 1.8.3.1