lkml.org 
[lkml]   [2020]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2] PM / EM: Micro optimization in em_cpu_energy
From
Date
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!


\
 
 \ /
  Last update: 2020-11-24 18:17    [W:0.071 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site