]> git.baikalelectronics.ru Git - kernel.git/commit
block: Use try_cmpxchg in update_io_ticks
authorUros Bizjak <ubizjak@gmail.com>
Tue, 12 Jul 2022 15:27:41 +0000 (17:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 12 Jul 2022 20:39:06 +0000 (14:39 -0600)
commit18a23aa6a4b0135a6267dea008d46f2600c97bf8
tree71f1874add6d679773e8bd0d4000690fde284f85
parent73ab07170373883070c57f5831db11cf4c485701
block: Use try_cmpxchg in update_io_ticks

Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
update_io_ticks. x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related
move instruction in front of cmpxchg).

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20220712152741.7324-1-ubizjak@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c