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 <quic_ashayj@quicinc.com>
This commit is contained in:
Ashay Jaiswal 2022-05-10 14:33:44 +05:30 committed by Rishabh Bhatnagar
parent 36c37e32ce
commit 4c409fadbe

View File

@ -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],