From: Pierre Gondois <Pierre.Gondois@xxxxxxx>
find_energy_efficient_cpu() searches the best energy CPU
to place a task on. To do so, the energy of each performance domain
(pd) is computed w/ and w/o the task placed in each pd.
The energy of a pd w/o the task (base_energy_pd) is computed prior
knowing whether a CPU is available in the pd.
Move the base_energy_pd computation after looping through the CPUs
of a pd and only computes it if at least one CPU is available.
Suggested-by: Xuewen Yan <xuewen.yan@xxxxxxxxxx>
Signed-off-by: Pierre Gondois <Pierre.Gondois@xxxxxxx>
---
kernel/sched/fair.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)