From 2d62be95bcc80be0a26696f7206afff8cb4b0e0f Mon Sep 17 00:00:00 2001 From: "lakkyung.jung" Date: Tue, 13 Mar 2018 19:05:13 +0900 Subject: [PATCH] [COMMON] sched: fair: Adjust average load considering CPU capacity. Change-Id: Id606bb8ebe305f684ed097da5fd7fa809eae5f17 Signed-off-by: lakkyung.jung --- kernel/sched/fair.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 82dad9ecddb8..6c224355bf92 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8989,6 +8989,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, { unsigned long load; int i, nr_running; + unsigned int sg_cpu; memset(sgs, 0, sizeof(*sgs)); @@ -9033,8 +9034,10 @@ static inline void update_sg_lb_stats(struct lb_env *env, } /* Adjust by relative CPU capacity of the group */ + sg_cpu = cpumask_first(sched_group_span(group)); sgs->group_capacity = group->sgc->capacity; - sgs->avg_load = (sgs->group_load*SCHED_CAPACITY_SCALE) / sgs->group_capacity; + sgs->avg_load = (sgs->group_load * capacity_orig_of(sg_cpu)) / + sgs->group_capacity; if (sgs->sum_nr_running) sgs->load_per_task = sgs->sum_weighted_load / sgs->sum_nr_running; -- 2.20.1