sched/walt: Check reserved CPU during walt_newidle_balance

Currently, it is observed that multiple calls to active_load_balance can
take place.

For example, say two Big threads are running on Golds, and
become misfits at the same time. Then, Prime which is currently say
halted, will end up pulling both threads. This is because first, as
Prime is unhalted, the CPU is kicked to enable it to pull tasks.
However, while Prime is kicked, it goes back to idle briefly, causing
the upstream newidle_balance path to come into play.

As a consequence, both threads are queued on Prime, and eventually, the
one sitting in the runqueue is put back on a Gold. This behavior is
unoptimal and unnecessary.

Ensure that walt_newidle_balance only takes when the CPU is not marked
as reserved.

Change-Id: I00feb8df3c4433333a356f2e855fb7a3ee848789
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
Shaleen Agrawal 2022-06-15 17:39:30 -07:00 committed by Rishabh Bhatnagar
parent 626213d61b
commit b18d15cb16

View File

@ -783,9 +783,6 @@ static void walt_newidle_balance(void *unused, struct rq *this_rq,
if (unlikely(walt_disabled))
return;
/*Cluster isn't initialized until after WALT is enabled*/
order_index = wrq->cluster->id;
/*
* newly idle load balance is completely handled here, so
* set done to skip the load balance by the caller.
@ -806,6 +803,12 @@ static void walt_newidle_balance(void *unused, struct rq *this_rq,
if (cpu_halted(this_cpu))
return;
if (is_reserved(this_cpu))
return;
/*Cluster isn't initialized until after WALT is enabled*/
order_index = wrq->cluster->id;
rq_unpin_lock(this_rq, rf);
/*