[PATCH] Directed yield: direct yield of spinlocks for powerpc
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Sun, 1 Oct 2006 06:27:44 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:22 +0000 (00:39 -0700)
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 <paulus@samba.org>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-powerpc/spinlock.h

index eaccac8327f2d23ffbed6dbc5c303bb669f3fb60..cc4cfceac67c16af4dc5326720ec0dda77fd6227 100644 (file)
@@ -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 */