[COMMON] sched: fair: Adjust average load considering CPU capacity.
authorlakkyung.jung <lakkyung.jung@samsung.com>
Tue, 13 Mar 2018 10:05:13 +0000 (19:05 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:30:46 +0000 (17:30 +0900)
Change-Id: Id606bb8ebe305f684ed097da5fd7fa809eae5f17
Signed-off-by: lakkyung.jung <lakkyung.jung@samsung.com>
kernel/sched/fair.c

index 82dad9ecddb8dd3e22e5caa03bacb1782073b784..6c224355bf92f02ba0e6b4cd173a55d7b15cf2e7 100644 (file)
@@ -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;