[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <165765839842.44219.4233753152017615209.b4-ty@kernel.dk>
Date: Tue, 12 Jul 2022 14:39:58 -0600
From: Jens Axboe <axboe@...nel.dk>
To: ubizjak@...il.com, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org
Subject: Re: [PATCH v2] block/rq_qos: Use atomic_try_cmpxchg in atomic_inc_below
On Tue, 12 Jul 2022 17:05:47 +0200, Uros Bizjak wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] block/rq_qos: Use atomic_try_cmpxchg in atomic_inc_below
commit: f4b1e27db49c8b985b116aa99481b4c6a4342ed4
Best regards,
--
Jens Axboe
Powered by blists - more mailing lists