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

Commit 258cafe4 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

sched/fair: correct fastpath



idle_get_state_idx() returns the idle state of the cpu - 0 being the
shallowest and higher values indicate deeper idle state.

The code currently chooses prev_cpu for a idle state of less than 1. 1
on our platforms corresponds to a deep idle state,and for mid and high
capacity cpus exiting from it incurs additional latency.

So amend the code such that for mid and high cluster cpus we limit
prev_cpu fastpath to the shallowest idle state. For min capacity cpus
using idle state of 1 is fine, as it doesn't incur huge idle exit
latencies.

Change-Id: Idb544015c8b533a2b1ad9c1355db3e975162f074
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent c0835c6a
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -6766,7 +6766,9 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
		!cpu_isolated(prev_cpu) && cpu_online(prev_cpu) &&
		!cpu_isolated(prev_cpu) && cpu_online(prev_cpu) &&
		idle_cpu(prev_cpu)) {
		idle_cpu(prev_cpu)) {


		if (idle_get_state_idx(cpu_rq(prev_cpu)) <= 1) {
		if (idle_get_state_idx(cpu_rq(prev_cpu)) <=
			(is_min_capacity_cpu(prev_cpu) ? 1 : 0)) {

			target_cpu = prev_cpu;
			target_cpu = prev_cpu;


			fbt_env->fastpath = PREV_CPU_FASTPATH;
			fbt_env->fastpath = PREV_CPU_FASTPATH;