Skip to content
Snippets Groups Projects
Commit 10803995 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Rafael J. Wysocki
Browse files

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: default avatarQuentin Perret <qperret@google.com>
Reviewed-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b56a352c
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, ...@@ -106,6 +106,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
struct em_perf_state *ps; struct em_perf_state *ps;
int i, cpu; int i, cpu;
if (!sum_util)
return 0;
/* /*
* In order to predict the performance state, map the utilization of * In order to predict the performance state, map the utilization of
* the most utilized CPU of the performance domain to a requested * the most utilized CPU of the performance domain to a requested
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment