[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZcYb_U45Jro_MMeJ@FVFF77S0Q05N.cambridge.arm.com>
Date: Fri, 9 Feb 2024 12:35:09 +0000
From: Mark Rutland <mark.rutland@....com>
To: Nhat Pham <nphamcs@...il.com>
Cc: linux-kernel@...r.kernel.org, boqun.feng@...il.com, frederic@...nel.org,
joel@...lfernandes.org, neeraj.iitr10@...il.com, paulmck@...nel.org,
peterz@...radead.org, will@...nel.org
Subject: Re: [PATCH] locking/atomic: scripts: clarify ordering of conditional
atomics
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@...il.com>
Thanks; I'll fold the above in for v2.
Mark.
Powered by blists - more mailing lists