[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a91e8216-7767-9126-e1d2-c67846cf32fc@gmail.com>
Date: Tue, 18 Oct 2022 16:40:06 +0900
From: Akira Yokosawa <akiyks@...il.com>
To: Arnd Bergmann <arnd@...db.de>, Parav Pandit <parav@...dia.com>
Cc: bagasdotme@...il.com, Alan Stern <stern@...land.harvard.edu>,
parri.andrea@...il.com, Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, boqun.feng@...il.com,
Nicholas Piggin <npiggin@...il.com>, dhowells@...hat.com,
j.alglave@....ac.uk, luc.maranget@...ia.fr,
"Paul E. McKenney" <paulmck@...nel.org>, dlustig@...dia.com,
Joel Fernandes <joel@...lfernandes.org>,
Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
Linux-Arch <linux-arch@...r.kernel.org>,
linux-doc@...r.kernel.org, Akira Yokosawa <akiyks@...il.com>
Subject: Re: [PATCH v4] locking/memory-barriers.txt: Improve documentation for
writel() example
On Tue, 18 Oct 2022 08:44:09 +0200, Arnd Bergmann wrote:
> On Tue, Oct 18, 2022, at 3:37 AM, Akira Yokosawa wrote:
>> On 2022/10/18 5:55, Arnd Bergmann wrote:
>>> On Mon, Oct 10, 2022, at 12:13 PM, Parav Pandit wrote:
>>
>> "a barrier" can mean "any barrier", which can include a full barrier
>> in theory.
>>
>> So I'd rather make the substituted text read something like:
>>
>> Note that, when using writel(), a prior wmb() or weaker is not
>> needed to guarantee that the cache coherent memory writes have
>> completed before writing to the MMIO region.
>>
>> In my opinion, "or weaker" is redundant for careful readers who are
>> well aware of context of this example, but won't do no harm.
>
> I think that would be more confusing than either of the other variants.
>
> Anything weaker than a full "wmb()" probably makes the driver calling
> the writel() non-portable, so that is both vague and incorrect.
Do you mean there is a writel() implementation somewhere in the kernel
which doesn't guarantee an implicit wmb() before MMIO write?
Or do you mean my version is confusing because it can imply a weaker
write barrier is sufficient before writel_relaxed()?
I'm confused...
Thanks, Akira
>
> The current version works because it specifically mentions the correct
> barrier to use, while Parav's version works because it doesn't
> make any attempt to name the specific barrier and just states that
> adding one is a bad idea regardless.
>
> Arnd
Powered by blists - more mailing lists