sched/fair: Start from prev_cpu in find_energy_efficient_cpu()
Start iterating on prev_cpu to know if prev_cpu is still a valid target
CPU for task p before iterating over other CPUs.
The task's uclamp.min value could have been raised while sleeping making
prev_cpu unfit for p.
The Perf Domain (PD) directly attached to the rq spans over prev_cpu
(cpu_rq(prev_cpu)->pd). All the other PDs start on the CPU closest
to prev_cpu clockwise.
Knowing whether prev_cpu is still a valid target CPU for p before
iterating over the other CPUs allows to consistently return prev_cpu
or -1 in the error cases (`prev_delta < base_energy_pd` or
`cur_delta < base_energy_pd`).
Signed-off-by:
Dietmar Eggemann <dietmar.eggemann@arm.com>
Loading
Please register or sign in to comment