x86, rwsem: Stay on fast path when count > 0 in __up_write()
[sfrench/cifs-2.6.git] / arch / x86 / include / asm / rwsem.h
index 606ede126972e568b992268da3df6f64b7e98480..5bf5e04e497fa83bf81f58d765c8e40d4d9f67ea 100644 (file)
@@ -216,9 +216,8 @@ static inline void __up_write(struct rw_semaphore *sem)
        rwsem_count_t tmp;
        asm volatile("# beginning __up_write\n\t"
                     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
-                    /* tries to transition
-                       0xffff0001 -> 0x00000000 */
-                    "  jz       1f\n"
+                    /* subtracts 0xffff0001, returns the old value */
+                    "  jns        1f\n\t"
                     "  call call_rwsem_wake\n"
                     "1:\n\t"
                     "# ending __up_write\n"