diff options
author | Uros Bizjak <[email protected]> | 2024-03-25 15:09:32 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2024-04-12 11:40:51 +0200 |
commit | 6a97734f2222e0352f1900e3eb3167e9069b91bb (patch) | |
tree | aeb9a451bb6965ca8c42f5f259a3aed935687624 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 79a34e3d8411050c3c7550c5163d6f9dc41e8f66 (diff) |
locking/pvqspinlock: Use try_cmpxchg_acquire() in trylock_clear_pending()
Replace this pattern in trylock_clear_pending():
cmpxchg_acquire(*ptr, old, new) == old
... with the simpler and faster:
try_cmpxchg_acquire(*ptr, &old, new)
The x86 CMPXCHG instruction returns success in the ZF flag, so this change
saves a compare after the CMPXCHG.
Also change the return type of the function to bool and streamline
the control flow in the _Q_PENDING_BITS == 8 variant a bit.
No functional change intended.
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Reviewed-by: Waiman Long <[email protected]>
Reviewed-by: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions