[PATCH v4 2/4] mutex: Make more scalable by doing less atomic operations

2013-04-17 Thread Waiman Long
In the __mutex_lock_common() function, an initial entry into the lock slow path will cause two atomic_xchg instructions to be issued. Together with the atomic decrement in the fast path, a total of three atomic read-modify-write instructions will be issued in rapid succession. This can cause a lot

[PATCH v4 2/4] mutex: Make more scalable by doing less atomic operations

2013-04-17 Thread Waiman Long
In the __mutex_lock_common() function, an initial entry into the lock slow path will cause two atomic_xchg instructions to be issued. Together with the atomic decrement in the fast path, a total of three atomic read-modify-write instructions will be issued in rapid succession. This can cause a lot