[patch 2.6.14-rc4] i386: spinlock optimization

From: Chuck Ebbert
Date: Fri Oct 14 2005 - 12:51:18 EST

Attempt to acquire spinlock sooner after spinning and then noticing
it has become available. Also adds a slight delay before testing the
spinlock again when it's not available, reducing bus traffic.

This change makes spinlocks fairer in the case where the owner drops
the lock and then immediately tries to take it again.

Signed-Off-By: Chuck Ebbert <76306.1226@xxxxxxxxxxxxxx>

include/asm-i386/spinlock.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

--- 2.6.14-rc4a.orig/include/asm-i386/spinlock.h
+++ 2.6.14-rc4a/include/asm-i386/spinlock.h
@@ -28,8 +28,8 @@
"2:\t" \
"rep;nop\n\t" \
"cmpb $0,%0\n\t" \
- "jle 2b\n\t" \
- "jmp 1b\n" \
+ "jg 1b\n\t" \
+ "jmp 2b\n" \

#define __raw_spin_lock_string_flags \
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/