diff options
author | Michel Lespinasse <walken@google.com> | 2010-07-20 18:19:45 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-20 20:41:00 -0400 |
commit | a751bd858b16dce57f3b6b85ba07946df1bd7be4 (patch) | |
tree | 1bd42b7a014003bbd733056dafec27078fed9e7e | |
parent | e0959371b4aaddb9b986019d5cfef93f9801d0ff (diff) |
x86, rwsem: Stay on fast path when count > 0 in __up_write()
When count > 0 there is no need to take the call_rwsem_wake path. If
we did take that path, it would just return without doing anything due
to the active count not being zero.
Signed-off-by: Michel Lespinasse <walken@google.com>
LKML-Reference: <201007202219.o6KMJj9x021042@imap1.linux-foundation.org>
Acked-by: David Howells <dhowells@redhat.com>
Cc: Mike Waychison <mikew@google.com>
Cc: Suleiman Souhlal <suleiman@google.com>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | arch/x86/include/asm/rwsem.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h index 606ede126972..5bf5e04e497f 100644 --- a/arch/x86/include/asm/rwsem.h +++ b/arch/x86/include/asm/rwsem.h | |||
@@ -216,9 +216,8 @@ static inline void __up_write(struct rw_semaphore *sem) | |||
216 | rwsem_count_t tmp; | 216 | rwsem_count_t tmp; |
217 | asm volatile("# beginning __up_write\n\t" | 217 | asm volatile("# beginning __up_write\n\t" |
218 | LOCK_PREFIX " xadd %1,(%2)\n\t" | 218 | LOCK_PREFIX " xadd %1,(%2)\n\t" |
219 | /* tries to transition | 219 | /* subtracts 0xffff0001, returns the old value */ |
220 | 0xffff0001 -> 0x00000000 */ | 220 | " jns 1f\n\t" |
221 | " jz 1f\n" | ||
222 | " call call_rwsem_wake\n" | 221 | " call call_rwsem_wake\n" |
223 | "1:\n\t" | 222 | "1:\n\t" |
224 | "# ending __up_write\n" | 223 | "# ending __up_write\n" |