Skip to content
Commit 3c0b7d96 authored by Dietmar Eggemann's avatar Dietmar Eggemann Committed by Deepak Kumar Mishra
Browse files

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's avatarDietmar Eggemann <dietmar.eggemann@arm.com>
parent 5a984058
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment