From 4c409fadbe79f9cfd4f96d485db73f8c190568f5 Mon Sep 17 00:00:00 2001 From: Ashay Jaiswal Date: Tue, 10 May 2022 14:33:44 +0530 Subject: [PATCH] sched: walt: allow silver to help prime during newidle balance Present newidle balance design doesn't allow farthest cluster to help during newidle balance (silver's newidle balance cannot help prime and prime cannot help silver). For Example: If silver is entering idle and it find's prime core busy then newidle balance will try to find and kick an idle gold core but it will not participate in pulling task from prime to silver. Update the logic to allow silver cluster to help and pull task during newidle balance if none of the cores in the nearest cluster (Gold here) are idle. Change-Id: I0908058d55f344467f559b50209a6bf8bb18b0ef Signed-off-by: Ashay Jaiswal --- kernel/sched/walt/walt_lb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/sched/walt/walt_lb.c b/kernel/sched/walt/walt_lb.c index f6ccf195eec2..500ec59807c4 100644 --- a/kernel/sched/walt/walt_lb.c +++ b/kernel/sched/walt/walt_lb.c @@ -840,13 +840,19 @@ static void walt_newidle_balance(void *unused, struct rq *this_rq, goto found_busy_cpu; } - /* help the farthest cluster indirectly if it needs help */ + /* + * help the farthest cluster by kicking an idle cpu in the next + * cluster. In case no idle is found, pull it in. + */ busy_cpu = walt_lb_find_busiest_cpu(this_cpu, &cpu_array[order_index][2], &has_misfit); if (busy_cpu != -1) { first_idle = find_first_idle_if_others_are_busy(&cpu_array[order_index][1]); - walt_kick_cpu(first_idle); + if (first_idle != 1) + walt_kick_cpu(first_idle); + else + goto found_busy_cpu; } } else if (order_index == 2) { busy_cpu = walt_lb_find_busiest_cpu(this_cpu, &cpu_array[order_index][0],