mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@riscstar.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Chandan Babu R <chandan.babu@oracle.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH] xfs: Use xchg() in xlog_cil_insert_pcp_aggregate()
Date: Wed, 20 Nov 2024 09:37:54 -0600	[thread overview]
Message-ID: <1a9a75bd-d946-40ec-8307-10fa04672300@riscstar.com> (raw)
In-Reply-To: <CAFULd4afgt7LtqzZ_oFDz4wtMe+TZKGX3E_XpSo2HD5rQEvOjg@mail.gmail.com>

On 11/20/24 9:36 AM, Uros Bizjak wrote:
> On Wed, Nov 20, 2024 at 4:34 PM Alex Elder <elder@riscstar.com> wrote:
>>
>> On 11/20/24 9:06 AM, Uros Bizjak wrote:
>>> try_cmpxchg() loop with constant "new" value can be substituted
>>> with just xchg() to atomically get and clear the location.
>>
>> You're right.  With a constant new value (0), there is no need
>> to loop to ensure we get a "stable" update.
>>
>> Is the READ_ONCE() is still needed?
> 
> No, xchg() guarantees atomic access on its own.
> 
> Uros.

Based on that:

Reviewed-by: Alex Elder <elder@riscstar.com>

  reply	other threads:[~2024-11-20 15:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 15:06 Uros Bizjak
2024-11-20 15:34 ` Alex Elder
2024-11-20 15:36   ` Uros Bizjak
2024-11-20 15:37     ` Alex Elder [this message]
2024-11-20 20:37 ` Dave Chinner
2024-11-28 12:19 ` Carlos Maiolino

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=1a9a75bd-d946-40ec-8307-10fa04672300@riscstar.com \
    --to=elder@riscstar.com \
    --cc=chandan.babu@oracle.com \
    --cc=dchinner@redhat.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ubizjak@gmail.com \
    /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®