From 9c208ca1ef7a379d70c39c3bf08d31b89d1f3389 Mon Sep 17 00:00:00 2001 From: Diep Quynh Date: Mon, 12 Apr 2021 04:07:50 +0700 Subject: [PATCH] sched: fair: Account PELT estimated utilization on WALT disabled cpu_util_cum This improves scheduler decision accuracy, on load balancing and EAS placement specifically Change-Id: I21733de68d9796e2c69605102e0fb5ea60e742b5 Signed-off-by: Diep Quynh Signed-off-by: Alexander Winkowski --- kernel/sched/sched.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 0e6f3df3da42..051f6700d293 100755 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2054,7 +2054,7 @@ static inline unsigned long __cpu_util(int cpu) unsigned int util; #ifdef CONFIG_SCHED_WALT - if (likely(!walt_disabled && sysctl_sched_use_walt_cpu_util)) { + if (!walt_disabled && sysctl_sched_use_walt_cpu_util) { u64 walt_cpu_util = cpu_rq(cpu)->walt_stats.cumulative_runnable_avg_scaled; @@ -2081,13 +2081,15 @@ struct sched_walt_cpu_load { static inline unsigned long cpu_util_cum(int cpu, int delta) { - u64 util = cpu_rq(cpu)->cfs.avg.util_avg; unsigned long capacity = capacity_orig_of(cpu); + u64 util; #ifdef CONFIG_SCHED_WALT - if (!walt_disabled && sysctl_sched_use_walt_cpu_util) - util = cpu_rq(cpu)->cum_window_demand_scaled; + util = cpu_util(cpu); +#else + util = __cpu_util(cpu); #endif + delta += util; if (delta < 0) return 0;