diff options
author | 2020-11-28 07:09:23 +0530 | |
---|---|---|
committer | 2020-12-08 18:21:16 +0100 | |
commit | 1080399542075bb0e9d46ea80418d76784d1ece8 (patch) | |
tree | 31748702d18f8cdc18f5e1688a43f5239dccf203 | |
parent | PM: EM: Update Energy Model with new flag indicating power scale (diff) | |
download | wireguard-linux-1080399542075bb0e9d46ea80418d76784d1ece8.tar.xz wireguard-linux-1080399542075bb0e9d46ea80418d76784d1ece8.zip |
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>
-rw-r--r-- | include/linux/energy_model.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index 9618c0a46ef4..757fc60658fa 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -106,6 +106,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, struct em_perf_state *ps; int i, cpu; + if (!sum_util) + return 0; + /* * In order to predict the performance state, map the utilization of * the most utilized CPU of the performance domain to a requested |