Skip to content

Commit 4e8e7d6

Browse files
Ke Wangpundiramit
authored andcommitted
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. Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
1 parent bf9ce3c commit 4e8e7d6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

kernel/sched/fair.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6723,6 +6723,7 @@ static int select_energy_cpu_brute(struct task_struct *p, int prev_cpu, int sync
67236723
/* No energy saving for target_cpu, try backup */
67246724
target_cpu = tmp_backup;
67256725
eenv.dst_cpu = target_cpu;
6726+
eenv.trg_cpu = target_cpu;
67266727
if (tmp_backup < 0 ||
67276728
tmp_backup == prev_cpu ||
67286729
energy_diff(&eenv) >= 0) {

0 commit comments

Comments
 (0)