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

Commit 4c1a26c9 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/fair: dont run energy calculation unless necessary"

parents 37ca4aa7 10f7dc07
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -7425,6 +7425,19 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
	if (*backup_cpu == target_cpu)
		*backup_cpu = -1;

	/*
	 * 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;
	}

	return target_cpu;
}