]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
sched/fair: Only compute base_energy_pd if necessary
authorPierre Gondois <Pierre.Gondois@arm.com>
Tue, 4 May 2021 09:07:42 +0000 (10:07 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 12 May 2021 09:43:23 +0000 (11:43 +0200)
commit8d4c97c105ca0735b0d972d1025cb150a7008451
tree644bd9c3b94b8cc3e43ddb50ccc70c2539dfaa54
parente5e678e4fea26d73444f4427cbbaeab4fa79ecee
sched/fair: Only compute base_energy_pd if necessary

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 on it.

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 compute it if at least one CPU is available.

Suggested-by: Xuewen Yan <xuewen.yan@unisoc.com>
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Reviewed-by: Vincent Donnefort <vincent.donnefort@arm.com>
Link: https://lkml.kernel.org/r/20210504090743.9688-2-Pierre.Gondois@arm.com
kernel/sched/fair.c