From 7e37eb4f5fb75035f22a5f6c3004386015c6bc8b Mon Sep 17 00:00:00 2001 From: Xuewen Yan Date: Tue, 29 Oct 2024 18:50:27 +0800 Subject: [PATCH] ANDROID: fair: Bring back the find_busiest_group vh Because the commit: 82cf921432fc (sched/balancing: Rename find_busiest_group() => sched_balance_find_src_group()) and commit: 902e786c4a54 ("sched/fair: Combine EAS check with root_domain::overutilized access"), the find_busiest_group rvh was delted, so bring it back again. The vh comes from the commit: a2ca8408de61("ANDROID: sched: add restrict vendor hook to modify load balance behavior"), it allows vendors to modify load balance paths. Bug: 376197366 Change-Id: Ib52e452ec27830c8a3ecf2686ce083ad02c0a239 Signed-off-by: Xuewen Yan (cherry picked from commit 2bd049998a3190d94ca3561a6ab94156ef7fcf4e) --- kernel/sched/fair.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cb2e47839ff7..914e05be2eda 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11336,6 +11336,7 @@ static struct sched_group *sched_balance_find_src_group(struct lb_env *env) { struct sg_lb_stats *local, *busiest; struct sd_lb_stats sds; + int out_balance = 1; init_sd_lb_stats(&sds); @@ -11355,8 +11356,9 @@ static struct sched_group *sched_balance_find_src_group(struct lb_env *env) if (busiest->group_type == group_misfit_task) goto force_balance; + trace_android_rvh_find_busiest_group(sds.busiest, env->dst_rq, &out_balance); if (!is_rd_overutilized(env->dst_rq->rd) && - rcu_dereference(env->dst_rq->rd->pd)) + rcu_dereference(env->dst_rq->rd->pd) && out_balance) goto out_balanced; /* ASYM feature bypasses nice load balance check */