Files
linux/block
Uros Bizjak 96388f57d2 blk-cgroup: Use atomic{,64}_try_cmpxchg
Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old
in blkcg_unuse_delay, blkcg_set_delay and blkcg_clear_delay and
atomic64_try_cmpxchg in blkcg_scale_delay.  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 <ubizjak@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20220712154455.66868-1-ubizjak@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-12 15:46:03 -06:00
..
2022-06-16 16:59:28 -06:00
2022-06-27 06:29:12 -06:00
2022-07-06 06:46:25 -06:00
2020-03-17 20:55:21 +01:00
2022-07-06 06:46:25 -06:00
2022-07-06 06:46:25 -06:00
2022-03-31 12:58:38 -06:00
2021-09-14 00:22:15 -04:00
2022-02-02 07:49:59 -07:00
2021-10-18 06:17:01 -06:00
2022-06-27 06:29:11 -06:00
2022-02-02 07:49:59 -07:00
2022-03-07 12:48:35 -07:00