aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stat-cpi.py
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2022-09-08 17:12:00 +0200
committerJens Axboe <[email protected]>2022-09-08 09:22:42 -0600
commitc35227d4e8cbc70a6622cc7cc5f8c3bff513f1fa (patch)
tree2cf72382f2a2bbedf515081f5fb6d4513742b82a /tools/perf/scripts/python/stat-cpi.py
parent1de7c3cf48fc41cd95adb12bd1ea9033a917798a (diff)
sbitmap: Use atomic_long_try_cmpxchg in __sbitmap_queue_get_batch
Use atomic_long_try_cmpxchg instead of atomic_long_cmpxchg (*ptr, old, new) == old in __sbitmap_queue_get_batch. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, atomic_long_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications, e.g. an extra memory read can be avoided in the loop. No functional change intended. Cc: Jens Axboe <[email protected]> Signed-off-by: Uros Bizjak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions