aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lockref.c
diff options
context:
space:
mode:
authorJason Low <[email protected]>2014-06-11 18:37:21 +0000
committerIngo Molnar <[email protected]>2014-07-05 09:25:41 +0000
commit1e820c9608eace237e2c519d8fd9074aec479d81 (patch)
tree5d48b95b5b18110164bb9133e027fcc8d6872fbb /lib/lockref.c
parentlocking/mutexes: Correct documentation on mutex optimistic spinning (diff)
downloadkernel-1e820c9608eace237e2c519d8fd9074aec479d81.tar.gz
kernel-1e820c9608eace237e2c519d8fd9074aec479d81.zip
locking/mutexes: Delete the MUTEX_SHOW_NO_WAITER macro
MUTEX_SHOW_NO_WAITER() is a macro which checks for if there are "no waiters" on a mutex by checking if the lock count is non-negative. Based on feedback from the discussion in the earlier version of this patchset, the macro is not very readable. Furthermore, checking lock->count isn't always the correct way to determine if there are "no waiters" on a mutex. For example, a negative count on a mutex really only means that there "potentially" are waiters. Likewise, there can be waiters on the mutex even if the count is non-negative. Thus, "MUTEX_SHOW_NO_WAITER" doesn't always do what the name of the macro suggests. So this patch deletes the MUTEX_SHOW_NO_WAITERS() macro, directly use atomic_read() instead of the macro, and adds comments which elaborate on how the extra atomic_read() checks can help reduce unnecessary xchg() operations. Signed-off-by: Jason Low <[email protected]> Acked-by: Waiman Long <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/lockref.c')
0 files changed, 0 insertions, 0 deletions