Skip to content

Commit 1080399

Browse files
Pavankumar Kondetirafaeljw
authored andcommitted
PM / EM: Micro optimization in em_cpu_energy
When the sum of the utilization of CPUs in a power domain is zero, return the energy as 0 without doing any computations. Acked-by: Quentin Perret <qperret@google.com> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent b56a352 commit 1080399

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

include/linux/energy_model.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
106106
struct em_perf_state *ps;
107107
int i, cpu;
108108

109+
if (!sum_util)
110+
return 0;
111+
109112
/*
110113
* In order to predict the performance state, map the utilization of
111114
* the most utilized CPU of the performance domain to a requested

0 commit comments

Comments
 (0)