mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nhat Pham <nphamcs@gmail.com>
To: mark.rutland@arm.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: Tue,  6 Feb 2024 10:40:05 -0800	[thread overview]
Message-ID: <20240206184005.4125128-1-nphamcs@gmail.com> (raw)
In-Reply-To: <20240129122250.1086874-1-mark.rutland@arm.com>

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."

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

  parent reply	other threads:[~2024-02-06 18:40 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 [this message]
2024-02-09 12:35   ` Mark Rutland

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=20240206184005.4125128-1-nphamcs@gmail.com \
    --to=nphamcs@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=neeraj.iitr10@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®