From 1712d88806859fd46d06118c6450f0a66812c91b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 8 Oct 2014 13:22:40 +1100 Subject: core: Make secondary spin and locks use cpu_relax() This makes secondaries spinning waiting for a job and spinlocks use cpu_relax() which speeds up the primary thread and thus speeds up the boot process a bit. Also prettify a bit cpu_relax() implementation Signed-off-by: Benjamin Herrenschmidt --- core/cpu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'core/cpu.c') diff --git a/core/cpu.c b/core/cpu.c index cefb1f0..f962d7c 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -67,11 +67,10 @@ void cpu_relax(void) /* Relax a bit to give sibling threads some breathing space */ smt_low(); smt_very_low(); - asm volatile("nop; nop; nop\n"); - asm volatile("nop; nop; nop\n"); - asm volatile("nop; nop; nop\n"); - asm volatile("nop; nop; nop\n"); - asm volatile("nop; nop; nop\n"); + asm volatile("nop; nop; nop; nop\n"); + asm volatile("nop; nop; nop; nop\n"); + asm volatile("nop; nop; nop; nop\n"); + asm volatile("nop; nop; nop; nop\n"); smt_medium(); } -- cgit v1.1