aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorUros Bizjak <[email protected]>2022-07-12 17:05:47 +0200
committerJens Axboe <[email protected]>2022-07-12 14:38:52 -0600
commitf4b1e27db49c8b985b116aa99481b4c6a4342ed4 (patch)
tree00b3861f47de1e179c300fc038c78fc1a3854a5f /include/linux
parentf3ec5d11554778c24ac8915e847223ed71d104fc (diff)
block/rq_qos: Use atomic_try_cmpxchg in atomic_inc_below
Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old in atomic_inc_below. 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_try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails, enabling further code simplifications. No functional change intended. Signed-off-by: Uros Bizjak <[email protected]> Cc: Jens Axboe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions