linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / EM: Micro optimization in em_pd_energy
@ 2020-11-23 10:17 Pavankumar Kondeti
  2020-11-23 10:28 ` Quentin Perret
  2020-11-23 10:29 ` [PATCH V2] PM / EM: Micro optimization in em_cpu_energy Pavankumar Kondeti
  0 siblings, 2 replies; 9+ messages in thread
From: Pavankumar Kondeti @ 2020-11-23 10:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pavankumar Kondeti, Rafael J. Wysocki, Lukasz Luba,
	Quentin Perret, Daniel Lezcano, Gustavo A. R. Silva

When the sum of the utilization of CPUs in a power domain is zero,
return the energy as 0 without doing any computations.

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.


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] PM / EM: Micro optimization in em_pd_energy
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Quentin Perret @ 2020-11-23 10:28 UTC (permalink / raw)
  To: Pavankumar Kondeti
  Cc: linux-kernel, Rafael J. Wysocki, Lukasz Luba, Daniel Lezcano,
	Gustavo A. R. Silva

Hi Pavan,

On Monday 23 Nov 2020 at 15:47:57 (+0530), Pavankumar Kondeti wrote:
> When the sum of the utilization of CPUs in a power domain is zero,

s/power/performance

> return the energy as 0 without doing any computations.
> 
> 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

Makes sense to me, so with nit above:

Acked-by: Quentin Perret <qperret@google.com>

Thanks!
Quentin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH V2] PM / EM: Micro optimization in em_cpu_energy
  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:29 ` Pavankumar Kondeti
  2020-11-23 10:35   ` [PATCH V3] " Pavankumar Kondeti
  2020-11-24 17:15   ` [PATCH V2] " Rafael J. Wysocki
  1 sibling, 2 replies; 9+ messages in thread
From: Pavankumar Kondeti @ 2020-11-23 10:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pavankumar Kondeti, Lukasz Luba, Rafael J. Wysocki,
	Quentin Perret, Daniel Lezcano, Gustavo A. R. Silva

When the sum of the utilization of CPUs in a power domain is zero,
return the energy as 0 without doing any computations.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
---
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.


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH V3] PM / EM: Micro optimization in em_cpu_energy
  2020-11-23 10:29 ` [PATCH V2] PM / EM: Micro optimization in em_cpu_energy Pavankumar Kondeti
@ 2020-11-23 10:35   ` Pavankumar Kondeti
  2020-11-24 14:59     ` Dietmar Eggemann
  2020-11-24 17:15   ` [PATCH V2] " Rafael J. Wysocki
  1 sibling, 1 reply; 9+ messages in thread
From: Pavankumar Kondeti @ 2020-11-23 10:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pavankumar Kondeti, Lukasz Luba, Rafael J. Wysocki,
	Quentin Perret, Daniel Lezcano, Gustavo A. R. Silva

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] PM / EM: Micro optimization in em_pd_energy
  2020-11-23 10:28 ` Quentin Perret
@ 2020-11-23 10:44   ` Pavan Kondeti
  0 siblings, 0 replies; 9+ messages in thread
From: Pavan Kondeti @ 2020-11-23 10:44 UTC (permalink / raw)
  To: Quentin Perret
  Cc: linux-kernel, Rafael J. Wysocki, Lukasz Luba, Daniel Lezcano,
	Gustavo A. R. Silva

On Mon, Nov 23, 2020 at 10:28:39AM +0000, Quentin Perret wrote:
> Hi Pavan,
> 
> On Monday 23 Nov 2020 at 15:47:57 (+0530), Pavankumar Kondeti wrote:
> > When the sum of the utilization of CPUs in a power domain is zero,
> 
> s/power/performance
> 
> > return the energy as 0 without doing any computations.
> > 
> > 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
> 
> Makes sense to me, so with nit above:
> 
> Acked-by: Quentin Perret <qperret@google.com>
> 
Thanks Quentin. I have updated the patch as per your correction. 

Thanks,
Pavan

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V3] PM / EM: Micro optimization in em_cpu_energy
  2020-11-23 10:35   ` [PATCH V3] " Pavankumar Kondeti
@ 2020-11-24 14:59     ` Dietmar Eggemann
  0 siblings, 0 replies; 9+ messages in thread
From: Dietmar Eggemann @ 2020-11-24 14:59 UTC (permalink / raw)
  To: Pavankumar Kondeti, linux-kernel
  Cc: Lukasz Luba, Rafael J. Wysocki, Quentin Perret, Daniel Lezcano,
	Gustavo A. R. Silva

On 23/11/2020 11:35, Pavankumar Kondeti wrote:
> 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@codeaurora.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


LGTM.

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] PM / EM: Micro optimization in em_cpu_energy
  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 17:15   ` Rafael J. Wysocki
  2020-11-28  1:39     ` [RESEND PATCH V3] " Pavankumar Kondeti
  1 sibling, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2020-11-24 17:15 UTC (permalink / raw)
  To: Pavankumar Kondeti, linux-kernel
  Cc: Lukasz Luba, Quentin Perret, Daniel Lezcano, Gustavo A. R. Silva

On 11/23/2020 11:29 AM, Pavankumar Kondeti wrote:
> When the sum of the utilization of CPUs in a power domain is zero,
> return the energy as 0 without doing any computations.
>
> Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
> ---
> 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

If I'm to take this, please resend it with a CC to 
linux-pm@vger.kernel.org (and with the tags you've received so far).

Thanks!



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [RESEND PATCH V3] PM / EM: Micro optimization in em_cpu_energy
  2020-11-24 17:15   ` [PATCH V2] " Rafael J. Wysocki
@ 2020-11-28  1:39     ` Pavankumar Kondeti
  2020-12-08 17:24       ` Rafael J. Wysocki
  0 siblings, 1 reply; 9+ messages in thread
From: Pavankumar Kondeti @ 2020-11-28  1:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pm, Dietmar Eggemann, Pavankumar Kondeti, Lukasz Luba,
	Rafael J. Wysocki, Daniel Lezcano, Quentin Perret,
	Gustavo A. R. Silva

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.


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [RESEND PATCH V3] PM / EM: Micro optimization in em_cpu_energy
  2020-11-28  1:39     ` [RESEND PATCH V3] " Pavankumar Kondeti
@ 2020-12-08 17:24       ` Rafael J. Wysocki
  0 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2020-12-08 17:24 UTC (permalink / raw)
  To: Pavankumar Kondeti
  Cc: Linux Kernel Mailing List, Linux PM, Dietmar Eggemann,
	Lukasz Luba, Rafael J. Wysocki, Daniel Lezcano, Quentin Perret,
	Gustavo A. R. Silva

On Sat, Nov 28, 2020 at 3:21 AM Pavankumar Kondeti
<pkondeti@codeaurora.org> wrote:
>
> 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
> --

Applied as 5.11 material, thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-08 17:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` [RESEND PATCH V3] " Pavankumar Kondeti
2020-12-08 17:24       ` Rafael J. Wysocki

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