From: lakkyung.jung Date: Mon, 3 Sep 2018 04:37:55 +0000 (+0900) Subject: sched: ems: Fix calculate_energy bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=19bbe3c8b05056ef5521c20bfa74f1ebe8487bd2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sched: ems: Fix calculate_energy bug Change-Id: I13fda72d1a6529c245108da2d34bb6d40688d8cb Signed-off-by: lakkyung.jung --- diff --git a/kernel/sched/ems/energy.c b/kernel/sched/ems/energy.c index 5b98131bc3db..d7a13a35e642 100644 --- a/kernel/sched/ems/energy.c +++ b/kernel/sched/ems/energy.c @@ -116,6 +116,12 @@ static unsigned int calculate_energy(struct task_struct *p, int target_cpu) * cpu usuage that excludes cpu performance. */ for_each_cpu(i, cpu_coregroup_mask(cpu)) { + if (i == task_cpu(p)) + util[i] -= min_t(unsigned long, util[i], task_util_est(p)); + + if (i == target_cpu) + util[i] += task_util_est(p); + /* utilization with task exceeds max capacity of cpu */ if (util[i] >= capacity) { util_sum += SCHED_CAPACITY_SCALE;