]> git.baikalelectronics.ru Git - kernel.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)
commit091a7a5c0b901d59902a4110d8c241635577c2c5
tree644bd9c3b94b8cc3e43ddb50ccc70c2539dfaa54
parent8b42fe0f0e96a6abe5ed30ba7e733e0eef539563
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