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/lock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/lock.c') diff --git a/core/lock.c b/core/lock.c index 70fb994..6a8282f 100644 --- a/core/lock.c +++ b/core/lock.c @@ -87,9 +87,8 @@ void lock(struct lock *l) for (;;) { if (try_lock(l)) break; - smt_low(); + cpu_relax(); } - smt_medium(); } void unlock(struct lock *l) -- cgit v1.1