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

Commit ece6d3b7 authored by Ke Wang's avatar Ke Wang Committed by Todd Kjos
Browse files

sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu



If no energy saving for target_cpu in the calculation of energy_diff(),
backup_cpu will be set as the new dst_cpu for the next calculation. At this
point, we also need update the new trg_cpu as backup_cpu to make sure the
subsequent calculation of energy_diff() is correct.

Change-Id: If3b35b6dc54865f1cb4b1603134102d4422227d5
Signed-off-by: default avatarKe Wang <ke.wang@spreadtrum.com>
(cherry picked from commit b1923e22f4eca3e537e015d6ea3dce1187edea37)
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
parent 06d637c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7098,6 +7098,7 @@ static int select_energy_cpu_brute(struct task_struct *p, int prev_cpu, int sync
			/* No energy saving for target_cpu, try backup */
			target_cpu = tmp_backup;
			eenv.dst_cpu = target_cpu;
			eenv.trg_cpu = target_cpu;
			if (tmp_backup < 0 || 
			    tmp_backup == prev_cpu ||
			    energy_diff(&eenv) >= 0) {