From d761f8d843b41dd640dd7ab63cd2cb15437a3744 Mon Sep 17 00:00:00 2001 From: Xuewen Yan Date: Mon, 28 Apr 2025 11:32:07 +0800 Subject: [PATCH] ANDROID: vh: move the build_perf_domains rvh to sched_is_eas_possible() Since the commit 8f833c82cdab("sched/topology: Change behaviour of the 'sched_energy_aware' sysctl, based on the platform") has add more check in the sched_is_eas_possible(), and it add check in the sched_energy_aware_handler, so it is not enough to put the previous rvh only in the build_perf_domains(). Move it to the sched_is_eas_possible() to allow vendors building its own eas check. Bug: 414251487 Change-Id: I049ef8faebacd306c69a485e2720e051e1af19f9 Signed-off-by: Xuewen Yan --- kernel/sched/topology.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 19d588f15ec6..d047fa0024ad 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -222,6 +222,11 @@ static bool sched_is_eas_possible(const struct cpumask *cpu_mask) struct cpufreq_policy *policy; struct cpufreq_governor *gov; int i; + bool eas_check = false; + + trace_android_rvh_build_perf_domains(&eas_check); + if (eas_check) + return true; /* EAS is enabled for asymmetric CPU capacity topologies. */ for_each_cpu(i, cpu_mask) { @@ -432,12 +437,11 @@ static bool build_perf_domains(const struct cpumask *cpu_map) struct perf_domain *pd = NULL, *tmp; int cpu = cpumask_first(cpu_map); struct root_domain *rd = cpu_rq(cpu)->rd; - bool eas_check = false; if (!sysctl_sched_energy_aware) goto free; - trace_android_rvh_build_perf_domains(&eas_check); - if (!sched_is_eas_possible(cpu_map) && !eas_check) + + if (!sched_is_eas_possible(cpu_map)) goto free; for_each_cpu(i, cpu_map) {