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 <[email protected]> Reviewed-by: Dietmar Eggemann <[email protected]> Signed-off-by: Pavankumar Kondeti <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b56a352 commit 1080399

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)