diff mbox series

[1/2] arm64: Improve parking of stopped CPUs

Message ID 20190611181050.9647-1-aaro.koskinen@iki.fi (mailing list archive)
State New, archived
Headers show
Series [1/2] arm64: Improve parking of stopped CPUs | expand

Commit Message

Aaro Koskinen June 11, 2019, 6:10 p.m. UTC
From: Jayachandran C <jnair@caviumnetworks.com>

The current code puts the stopped cpus in an 'yield' instruction loop.
Using a busy loop here is unnecessary, we can use the cpu_park_loop()
function here to do a wfi/wfe.

Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---

	This is a rebased resend of the patch:

		https://patchwork.kernel.org/patch/9549145/

 arch/arm64/kernel/smp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Will Deacon June 13, 2019, 9:22 a.m. UTC | #1
On Tue, Jun 11, 2019 at 09:10:49PM +0300, Aaro Koskinen wrote:
> From: Jayachandran C <jnair@caviumnetworks.com>
> 
> The current code puts the stopped cpus in an 'yield' instruction loop.
> Using a busy loop here is unnecessary, we can use the cpu_park_loop()
> function here to do a wfi/wfe.
> 
> Signed-off-by: Jayachandran C <jnair@caviumnetworks.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> ---
> 
> 	This is a rebased resend of the patch:
> 
> 		https://patchwork.kernel.org/patch/9549145/
> 
>  arch/arm64/kernel/smp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index bb4b3f07761a..1a1b96a50245 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -854,9 +854,7 @@ static void ipi_cpu_stop(unsigned int cpu)
>  
>  	local_daif_mask();
>  	sdei_mask_local_cpu();
> -
> -	while (1)
> -		cpu_relax();
> +	cpu_park_loop();
>  }

Acked-by: Will Deacon <will.deacon@arm.com>

Will
diff mbox series

Patch

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index bb4b3f07761a..1a1b96a50245 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -854,9 +854,7 @@  static void ipi_cpu_stop(unsigned int cpu)
 
 	local_daif_mask();
 	sdei_mask_local_cpu();
-
-	while (1)
-		cpu_relax();
+	cpu_park_loop();
 }
 
 #ifdef CONFIG_KEXEC_CORE