[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <165766236676.63083.2141527891325153647.b4-ty@kernel.dk>
Date: Tue, 12 Jul 2022 15:46:06 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
ubizjak@...il.com
Subject: Re: [PATCH v2] blk-cgroup: Use atomic{,64}_try_cmpxchg
On Tue, 12 Jul 2022 17:44:55 +0200, Uros Bizjak wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] blk-cgroup: Use atomic{,64}_try_cmpxchg
commit: 96388f57d2aad9836b2c589181fa1dbaba4066b4
Best regards,
--
Jens Axboe
Powered by blists - more mailing lists