From cdc39363d33506b0e067d41fc91f89d186bdf7f7 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Sat, 30 Sep 2006 23:27:44 -0700 Subject: [PATCH] [PATCH] Directed yield: direct yield of spinlocks for powerpc Powerpc already has a directed yield for CONFIG_PREEMPT="n". To make it work with CONFIG_PREEMPT="y" as well the _raw_{spin,read,write}_relax primitives need to be defined to call __spin_yield() for spinlocks and __rw_yield() for rw-locks. Acked-by: Paul Mackerras Signed-off-by: Martin Schwidefsky Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/spinlock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h index eaccac8327f2..cc4cfceac67c 100644 --- a/include/asm-powerpc/spinlock.h +++ b/include/asm-powerpc/spinlock.h @@ -285,9 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) rw->lock = 0; } -#define _raw_spin_relax(lock) cpu_relax() -#define _raw_read_relax(lock) cpu_relax() -#define _raw_write_relax(lock) cpu_relax() +#define _raw_spin_relax(lock) __spin_yield(lock) +#define _raw_read_relax(lock) __rw_yield(lock) +#define _raw_write_relax(lock) __rw_yield(lock) #endif /* __KERNEL__ */ #endif /* __ASM_SPINLOCK_H */ -- 2.30.2