mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Pavel Begunkov (Silence)" <asml.silence@gmail.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] sbitmap: Replace cmpxchg with xchg
Date: Mon, 1 Jul 2019 13:44:44 -0600	[thread overview]
Message-ID: <77f4ee3b-a190-5708-f30b-0c5f2b933b3e@kernel.dk> (raw)
In-Reply-To: <722e1d561f0a49dc464d3a2b1be4c077f7502726.1558625912.git.asml.silence@gmail.com>

On 5/23/19 9:39 AM, Pavel Begunkov (Silence) wrote:
> From: Pavel Begunkov <asml.silence@gmail.com>
> 
> cmpxchg() with an immediate value could be replaced with less expensive
> xchg(). The same true if new value don't _depend_ on the old one.
> 
> In the second block, atomic_cmpxchg() return value isn't checked, so
> after atomic_cmpxchg() ->  atomic_xchg() conversion it could be replaced
> with atomic_set(). Comparison with atomic_read() in the second chunk was
> left as an optimisation (if that was the initial intention).

Applied, thanks.

-- 
Jens Axboe


      parent reply	other threads:[~2019-07-01 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 15:39 Pavel Begunkov (Silence)
2019-06-29 15:42 ` Pavel Begunkov
2019-06-29 15:51   ` Jens Axboe
2019-07-01 17:35   ` Omar Sandoval
2019-07-01 19:44 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77f4ee3b-a190-5708-f30b-0c5f2b933b3e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®