Re: [PATCH v2 1/2] sched/fair: Only compute base_energy_pd if necessary

From: Lukasz Luba
Date: Fri Apr 30 2021 - 07:06:38 EST


Hi Pierre,

On 4/29/21 11:19 AM, Pierre.Gondois@xxxxxxx wrote:
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(-)


Make sense. I will speed-up feec() on Android devices for tasks
being moved into 'background' cgroup (limited to subset of CPUs,
e.g. to only Little cores). LGTM.

Reviewed-by: Lukasz Luba <lukasz.luba@xxxxxxx>

Regards,
Lukasz