diff mbox series

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

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

Commit Message

Aaro Koskinen June 17, 2019, 8:35 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>
Acked-by: Will Deacon <will.deacon@arm.com>
---

	v2: Add Acked-by

	v1: https://patchwork.kernel.org/patch/10988099/

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

Comments

Catalin Marinas June 25, 2019, 3:43 p.m. UTC | #1
On Mon, Jun 17, 2019 at 11:35:18PM +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>
> Acked-by: Will Deacon <will.deacon@arm.com>

Both patches queued for 5.3. Thanks.
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