linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavankumar Kondeti <pkondeti@codeaurora.org>
To: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Pavankumar Kondeti <pkondeti@codeaurora.org>,
	Lukasz Luba <lukasz.luba@arm.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Quentin Perret <qperret@google.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: [RESEND PATCH V3] PM / EM: Micro optimization in em_cpu_energy
Date: Sat, 28 Nov 2020 07:09:23 +0530	[thread overview]
Message-ID: <1606527564-27238-1-git-send-email-pkondeti@codeaurora.org> (raw)
In-Reply-To: <671427cc-2abb-68eb-5e54-0851785efa84@intel.com>

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>
---
 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.


  reply	other threads:[~2020-11-28  1:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 10:17 [PATCH] PM / EM: Micro optimization in em_pd_energy Pavankumar Kondeti
2020-11-23 10:28 ` Quentin Perret
2020-11-23 10:44   ` Pavan Kondeti
2020-11-23 10:29 ` [PATCH V2] PM / EM: Micro optimization in em_cpu_energy Pavankumar Kondeti
2020-11-23 10:35   ` [PATCH V3] " Pavankumar Kondeti
2020-11-24 14:59     ` Dietmar Eggemann
2020-11-24 17:15   ` [PATCH V2] " Rafael J. Wysocki
2020-11-28  1:39     ` Pavankumar Kondeti [this message]
2020-12-08 17:24       ` [RESEND PATCH V3] " Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1606527564-27238-1-git-send-email-pkondeti@codeaurora.org \
    --to=pkondeti@codeaurora.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=qperret@google.com \
    --cc=rafael.j.wysocki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).