Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b65363e authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

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: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent f27ee2ff
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7218,7 +7218,9 @@ int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
	 * 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;