Skip to content

Commit

Permalink
[PATCH] Directed yield: direct yield of spinlocks for powerpc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Schwidefsky authored and Linus Torvalds committed Oct 1, 2006
1 parent ef6edc9 commit cdc3936
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/asm-powerpc/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit cdc3936

Please sign in to comment.