sched/fair: skip 6% energy check when best_energy_cpu is idle

Even though best_energy_cpu is idle and which would consume
same amount of energy as prev cpu, due to 6% check with prev cpu,
we end up choosing prev cpu over best_energy_cpu for the tasks.
This leads to increase in runnables. Choose best_energy_cpu when
it is idle and shallowest c-state over prev cpu in such scenarios
to avoid runnables.

Change-Id: Ib9eee263640bcd43bd80f8f777a8312585991bc5
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2019-12-10 17:18:38 -08:00
commit 3b65363e48

View file

@ -7218,7 +7218,9 @@ unlock:
* Pick the prev CPU, if best energy CPU can't saves at least 6% of
* the energy used by prev_cpu.
*/
if ((prev_delta != ULONG_MAX) && (best_energy_cpu != prev_cpu) &&
if (!(idle_cpu(best_energy_cpu) &&
idle_get_state_idx(cpu_rq(best_energy_cpu)) <= 0) &&
(prev_delta != ULONG_MAX) && (best_energy_cpu != prev_cpu) &&
((prev_delta - best_delta) <= prev_delta >> 4) &&
(capacity_orig_of(prev_cpu) <= capacity_orig_of(start_cpu)))
best_energy_cpu = prev_cpu;