diff options
author | Waiman Long <[email protected]> | 2021-04-26 14:50:17 -0400 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2021-05-06 15:33:49 +0200 |
commit | 28ce0e70ecc30cc7d558a0304e6b816d70848f9a (patch) | |
tree | cf69b286807b78a02a43efbca299420f57cdef1b /lib/mpi/mpi-sub-ui.c | |
parent | 1139aeb1c521eb4a050920ce6c64c36c4f2a3ab7 (diff) |
locking/qrwlock: Cleanup queued_write_lock_slowpath()
Make the code more readable by replacing the atomic_cmpxchg_acquire()
by an equivalent atomic_try_cmpxchg_acquire() and change atomic_add()
to atomic_or().
For architectures that use qrwlock, I do not find one that has an
atomic_add() defined but not an atomic_or(). I guess it should be fine
by changing atomic_add() to atomic_or().
Note that the previous use of atomic_add() isn't wrong as only one
writer that is the wait_lock owner can set the waiting flag and the
flag will be cleared later on when acquiring the write lock.
Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Waiman Long <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Will Deacon <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'lib/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions