[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1606127734-14507-1-git-send-email-pkondeti@codeaurora.org>
Date: Mon, 23 Nov 2020 16:05:32 +0530
From: Pavankumar Kondeti <pkondeti@...eaurora.org>
To: linux-kernel@...r.kernel.org
Cc: Pavankumar Kondeti <pkondeti@...eaurora.org>,
Lukasz Luba <lukasz.luba@....com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Quentin Perret <qperret@...gle.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH V3] PM / EM: Micro optimization in em_cpu_energy
When the sum of the utilization of CPUs in a performance domain is
zero, return the energy as 0 without doing any computations.
Signed-off-by: Pavankumar Kondeti <pkondeti@...eaurora.org>
---
V3: %s/power/performance as corrected by Quentin
V2: Fixed the function name in the commit message.
include/linux/energy_model.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
index b67a51c..8810f1f 100644
--- a/include/linux/energy_model.h
+++ b/include/linux/energy_model.h
@@ -103,6 +103,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
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Powered by blists - more mailing lists