[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9cce17dc-2fba-d339-e88b-b76eb9a382b4@kernel.dk>
Date: Thu, 8 Sep 2022 08:40:53 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Uros Bizjak <ubizjak@...il.com>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] sbitmap: Use atomic_{,long}_try_cmpxchg in
sbitmap.c
On 9/7/22 12:21 PM, Uros Bizjak wrote:
> Use atomic_long_try_cmpxchg instead of
> atomic_long_cmpxchg (*ptr, old, new) == old in __sbitmap_queue_get_batch
> and atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old
> in __sbq_wake_up. 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_long_cmpxchg implicitly assigns old *ptr value to "old"
> when cmpxchg fails, enabling further code simplifications, e.g.
> an extra memory read can be avoided in the loop.
>
> No functional change intended.
It doesn't apply to the current tree, can you please resend one against
for-6.1/block?
--
Jens Axboe
Powered by blists - more mailing lists