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

Commit 74ccfe03 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

sched/fair: Allow prev cpu in find best target



Change 10f7dc075b87361d42d0145b74bfd75f28cc4545 ("sched/fair: dont run
energy calculation unless necessary") then assumed that the cpus
returned from find_best_target() would be used for energy evaluation.

Later, code was added to use the target cpu returned by fbt() in certain
latency sensitive situations. This lead to skipping prev_cpu, since it
could have been the target cpu had the above mentioned change not
dropped it.

So revert 10f7dc075b87361d42d0145b74bfd75f28cc4545 ("sched/fair: dont run
energy calculation unless necessary")

Change-Id: I06827ce9339f698dd3927a103b4c1a1ddbe123e2
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 89162be6
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -7123,19 +7123,6 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
		!(p->state == TASK_RUNNING && !idle_cpu(most_spare_cap_cpu)))
		target_cpu = most_spare_cap_cpu;

	/*
	 * The next step of energy evaluation includes
	 * prev_cpu. Drop target or backup if it is
	 * same as prev_cpu
	 */
	if (backup_cpu == prev_cpu)
		backup_cpu = -1;

	if (target_cpu == prev_cpu) {
		target_cpu = backup_cpu;
		backup_cpu = -1;
	}

	if (target_cpu == -1 && isolated_candidate != -1 &&
					cpu_isolated(prev_cpu))
		target_cpu = isolated_candidate;