mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Nhat Pham <nphamcs@gmail.com>
Cc: linux-kernel@vger.kernel.org, boqun.feng@gmail.com,
	frederic@kernel.org, joel@joelfernandes.org,
	neeraj.iitr10@gmail.com, paulmck@kernel.org,
	peterz@infradead.org, will@kernel.org
Subject: Re: [PATCH] locking/atomic: scripts: clarify ordering of conditional atomics
Date: Fri, 9 Feb 2024 12:35:09 +0000	[thread overview]
Message-ID: <ZcYb_U45Jro_MMeJ@FVFF77S0Q05N.cambridge.arm.com> (raw)
In-Reply-To: <20240206184005.4125128-1-nphamcs@gmail.com>

On Tue, Feb 06, 2024 at 10:40:05AM -0800, Nhat Pham wrote:
> Let me bring in some beginners' perspective :)
> 
> For the most part, LGTM! My only comment is regarding the conditional
> atomics with relaxed ordering on success:
> 
> /**
>   * If (@v == @old), atomically updates @v to @new with relaxed ordering.
> + * Otherwise, @v is not modified and no ordering is provided.
> 
> This is technically correct, but it can be confusing. It reads as if
> "relaxed ordering" is much different from no ordering, since we are
> juxtaposing them when we compare what happens when the condition holds
> v.s when it does not.
> 
> This can be potentially confusing to unfamiliar users. I consulted
> with Paul about this, and he suggested this rewording, which I like
> better:
> 
> "Otherwise, @v is not modified and relaxed ordering is provided."

I agree that makes sense, and doing the same in the commit message makes that
simpler and clearer too!

> With something along that line in place:
> Reviewed-by: Nhat Pham <nphamcs@gmail.com>

Thanks; I'll fold the above in for v2.

Mark.

      reply	other threads:[~2024-02-09 12:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 12:22 Mark Rutland
2024-01-29 12:33 ` Paul E. McKenney
2024-02-06 18:40 ` Nhat Pham
2024-02-09 12:35   ` Mark Rutland [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=ZcYb_U45Jro_MMeJ@FVFF77S0Q05N.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.iitr10@gmail.com \
    --cc=nphamcs@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@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®