linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
@ 2020-12-10  5:47 Viresh Kumar
  2020-12-10  9:37 ` Sudeep Holla
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Viresh Kumar @ 2020-12-10  5:47 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Sudeep Holla, Ionela Voinescu
  Cc: Viresh Kumar, Vincent Guittot, linux-kernel, linux-arm-kernel

The previous call to update_freq_counters_refs() has already updated the
per-cpu variables, don't overwrite them with the same value again.

Fixes: 4b9cf23c179a ("arm64: wrap and generalise counter read functions")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 arch/arm64/kernel/topology.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index c8308befdb1e..f6faa697e83e 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -314,7 +314,7 @@ void topology_scale_freq_tick(void)
 
 	if (unlikely(core_cnt <= prev_core_cnt ||
 		     const_cnt <= prev_const_cnt))
-		goto store_and_exit;
+		return;
 
 	/*
 	 *	    /\core    arch_max_freq_scale
@@ -331,10 +331,6 @@ void topology_scale_freq_tick(void)
 
 	scale = min_t(unsigned long, scale, SCHED_CAPACITY_SCALE);
 	this_cpu_write(freq_scale, (unsigned long)scale);
-
-store_and_exit:
-	this_cpu_write(arch_core_cycles_prev, core_cnt);
-	this_cpu_write(arch_const_cycles_prev, const_cnt);
 }
 
 #ifdef CONFIG_ACPI_CPPC_LIB
-- 
2.25.0.rc1.19.g042ed3e048af


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
  2020-12-10  5:47 [PATCH] arm64: topology: Drop the useless update to per-cpu cycles Viresh Kumar
@ 2020-12-10  9:37 ` Sudeep Holla
  2020-12-10  9:57 ` Ionela Voinescu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2020-12-10  9:37 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Vincent Guittot, Ionela Voinescu, Catalin Marinas, linux-kernel,
	Sudeep Holla, Will Deacon, linux-arm-kernel

On Thu, Dec 10, 2020 at 11:17:40AM +0530, Viresh Kumar wrote:
> The previous call to update_freq_counters_refs() has already updated the
> per-cpu variables, don't overwrite them with the same value again.
>

Good catch!

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
  2020-12-10  5:47 [PATCH] arm64: topology: Drop the useless update to per-cpu cycles Viresh Kumar
  2020-12-10  9:37 ` Sudeep Holla
@ 2020-12-10  9:57 ` Ionela Voinescu
  2020-12-11  6:48 ` Viresh Kumar
  2020-12-15 17:44 ` Catalin Marinas
  3 siblings, 0 replies; 6+ messages in thread
From: Ionela Voinescu @ 2020-12-10  9:57 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Vincent Guittot, Catalin Marinas, linux-kernel, Sudeep Holla,
	Will Deacon, linux-arm-kernel

On Thursday 10 Dec 2020 at 11:17:40 (+0530), Viresh Kumar wrote:
> The previous call to update_freq_counters_refs() has already updated the
> per-cpu variables, don't overwrite them with the same value again.
> 
> Fixes: 4b9cf23c179a ("arm64: wrap and generalise counter read functions")
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  arch/arm64/kernel/topology.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> index c8308befdb1e..f6faa697e83e 100644
> --- a/arch/arm64/kernel/topology.c
> +++ b/arch/arm64/kernel/topology.c
> @@ -314,7 +314,7 @@ void topology_scale_freq_tick(void)
>  
>  	if (unlikely(core_cnt <= prev_core_cnt ||
>  		     const_cnt <= prev_const_cnt))
> -		goto store_and_exit;
> +		return;
>  
>  	/*
>  	 *	    /\core    arch_max_freq_scale
> @@ -331,10 +331,6 @@ void topology_scale_freq_tick(void)
>  
>  	scale = min_t(unsigned long, scale, SCHED_CAPACITY_SCALE);
>  	this_cpu_write(freq_scale, (unsigned long)scale);
> -
> -store_and_exit:
> -	this_cpu_write(arch_core_cycles_prev, core_cnt);
> -	this_cpu_write(arch_const_cycles_prev, const_cnt);
>  }

Right, no need for this anymore!

Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com>

Thank you for the fix,
Ionela.

>  
>  #ifdef CONFIG_ACPI_CPPC_LIB
> -- 
> 2.25.0.rc1.19.g042ed3e048af
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
  2020-12-10  5:47 [PATCH] arm64: topology: Drop the useless update to per-cpu cycles Viresh Kumar
  2020-12-10  9:37 ` Sudeep Holla
  2020-12-10  9:57 ` Ionela Voinescu
@ 2020-12-11  6:48 ` Viresh Kumar
  2020-12-15 12:30   ` Catalin Marinas
  2020-12-15 17:44 ` Catalin Marinas
  3 siblings, 1 reply; 6+ messages in thread
From: Viresh Kumar @ 2020-12-11  6:48 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Sudeep Holla, Ionela Voinescu
  Cc: Vincent Guittot, linux-kernel, linux-arm-kernel

On 10-12-20, 11:17, Viresh Kumar wrote:
> The previous call to update_freq_counters_refs() has already updated the
> per-cpu variables, don't overwrite them with the same value again.
> 
> Fixes: 4b9cf23c179a ("arm64: wrap and generalise counter read functions")
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  arch/arm64/kernel/topology.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> index c8308befdb1e..f6faa697e83e 100644
> --- a/arch/arm64/kernel/topology.c
> +++ b/arch/arm64/kernel/topology.c
> @@ -314,7 +314,7 @@ void topology_scale_freq_tick(void)
>  
>  	if (unlikely(core_cnt <= prev_core_cnt ||
>  		     const_cnt <= prev_const_cnt))
> -		goto store_and_exit;
> +		return;
>  
>  	/*
>  	 *	    /\core    arch_max_freq_scale
> @@ -331,10 +331,6 @@ void topology_scale_freq_tick(void)
>  
>  	scale = min_t(unsigned long, scale, SCHED_CAPACITY_SCALE);
>  	this_cpu_write(freq_scale, (unsigned long)scale);
> -
> -store_and_exit:
> -	this_cpu_write(arch_core_cycles_prev, core_cnt);
> -	this_cpu_write(arch_const_cycles_prev, const_cnt);
>  }
>  
>  #ifdef CONFIG_ACPI_CPPC_LIB

Catalin: Can you please pick this up for 5.11-rc1, the earlier patch
(from fixes) is already in your tree. Thanks.

-- 
viresh

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
  2020-12-11  6:48 ` Viresh Kumar
@ 2020-12-15 12:30   ` Catalin Marinas
  0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2020-12-15 12:30 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Vincent Guittot, Will Deacon, linux-kernel, Sudeep Holla,
	Ionela Voinescu, linux-arm-kernel

On Fri, Dec 11, 2020 at 12:18:50PM +0530, Viresh Kumar wrote:
> On 10-12-20, 11:17, Viresh Kumar wrote:
> > The previous call to update_freq_counters_refs() has already updated the
> > per-cpu variables, don't overwrite them with the same value again.
> > 
> > Fixes: 4b9cf23c179a ("arm64: wrap and generalise counter read functions")
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> >  arch/arm64/kernel/topology.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> > index c8308befdb1e..f6faa697e83e 100644
> > --- a/arch/arm64/kernel/topology.c
> > +++ b/arch/arm64/kernel/topology.c
> > @@ -314,7 +314,7 @@ void topology_scale_freq_tick(void)
> >  
> >  	if (unlikely(core_cnt <= prev_core_cnt ||
> >  		     const_cnt <= prev_const_cnt))
> > -		goto store_and_exit;
> > +		return;
> >  
> >  	/*
> >  	 *	    /\core    arch_max_freq_scale
> > @@ -331,10 +331,6 @@ void topology_scale_freq_tick(void)
> >  
> >  	scale = min_t(unsigned long, scale, SCHED_CAPACITY_SCALE);
> >  	this_cpu_write(freq_scale, (unsigned long)scale);
> > -
> > -store_and_exit:
> > -	this_cpu_write(arch_core_cycles_prev, core_cnt);
> > -	this_cpu_write(arch_const_cycles_prev, const_cnt);
> >  }
> >  
> >  #ifdef CONFIG_ACPI_CPPC_LIB
> 
> Catalin: Can you please pick this up for 5.11-rc1, the earlier patch
> (from fixes) is already in your tree. Thanks.

I will add it to the second pull request this merging window. Thanks.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: topology: Drop the useless update to per-cpu cycles
  2020-12-10  5:47 [PATCH] arm64: topology: Drop the useless update to per-cpu cycles Viresh Kumar
                   ` (2 preceding siblings ...)
  2020-12-11  6:48 ` Viresh Kumar
@ 2020-12-15 17:44 ` Catalin Marinas
  3 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2020-12-15 17:44 UTC (permalink / raw)
  To: Sudeep Holla, Will Deacon, Ionela Voinescu, Viresh Kumar
  Cc: Vincent Guittot, linux-kernel, linux-arm-kernel

On Thu, 10 Dec 2020 11:17:40 +0530, Viresh Kumar wrote:
> The previous call to update_freq_counters_refs() has already updated the
> per-cpu variables, don't overwrite them with the same value again.

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: topology: Drop the useless update to per-cpu cycles
      https://git.kernel.org/arm64/c/51550a483606

-- 
Catalin


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-10  5:47 [PATCH] arm64: topology: Drop the useless update to per-cpu cycles Viresh Kumar
2020-12-10  9:37 ` Sudeep Holla
2020-12-10  9:57 ` Ionela Voinescu
2020-12-11  6:48 ` Viresh Kumar
2020-12-15 12:30   ` Catalin Marinas
2020-12-15 17:44 ` Catalin Marinas

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