[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160127075129.GH6357@twins.programming.kicks-ass.net>
Date: Wed, 27 Jan 2016 08:51:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul McKenney <paulmck@...ux.vnet.ibm.com>,
Boqun Feng <boqun.feng@...il.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Leonid Yegoshin <Leonid.Yegoshin@...tec.com>,
linux-mips <linux-mips@...ux-mips.org>,
"linux-ia64@...r.kernel.org" <linux-ia64@...r.kernel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Will Deacon <will.deacon@....com>,
virtualization <virtualization@...ts.linux-foundation.org>,
Peter Anvin <hpa@...or.com>, sparclinux@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
linux-s390 <linux-s390@...r.kernel.org>,
Russell King - ARM Linux <linux@....linux.org.uk>,
uml-devel <user-mode-linux-devel@...ts.sourceforge.net>,
linux-sh@...r.kernel.org, Michael Ellerman <mpe@...erman.id.au>,
the arch/x86 maintainers <x86@...nel.org>,
xen-devel@...ts.xenproject.org, Ingo Molnar <mingo@...e.hu>,
linux-xtensa@...ux-xtensa.org,
James Hogan <james.hogan@...tec.com>,
Arnd Bergmann <arnd@...db.de>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
adi-buildroot-devel@...ts.sourceforge.net,
David Daney <ddaney.cavm@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
linux-metag@...r.kernel.org,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Joe Perches <joe@...ches.com>,
ppc-dev <linuxppc-dev@...ts.ozlabs.org>,
David Miller <davem@...emloft.net>
Subject: Re: [v3,11/41] mips: reuse asm-generic/barrier.h
On Tue, Jan 26, 2016 at 02:33:40PM -0800, Linus Torvalds wrote:
> If it turns out that some architecture does actually need a barrier
> between a read and a dependent write, then that will mean that
>
> (a) we'll have to make up a _new_ barrier, because
> "smp_read_barrier_depends()" is not that barrier. We'll presumably
> then have to make that new barrier part of "rcu_derefence()" and
> friends.
>
> (b) we will have found an architecture with even worse memory
> ordering semantics than alpha, and we'll have to stop castigating
> alpha for being the worst memory ordering ever.
>
> but I sincerely hope that we'll never find that kind of broken architecture.
So for a moment it looked like MIPS wanted to equal or surpass Alpha in
this respect.
And Paul made the point that smp_read_barrier_depends() really should
be smp_aquire_barrier_depends() in that we rely on both dependent reads
and writes to be ordered against the initial pointer load.
Now, as you've made abundantly clear, Alpha does this, although it needs
the little extra help in the dependent read department.
The 'problem' is that someone seemed to have used our
Documentation/memory-barriers.txt as a specification for what hardware
is permitted and we require. And in that light Paul noted that
read_barrier_depends really should be considered an
acquire_barrier_depends and order both dependent reads and writes
against the (prior) read (if nothing else already does).
Now clearly, any sane architecture doesn't need anything like this, but
again our document doesn't seem to judge. That is, from reading the
document one can get the impression is a perfectly fine thing to do.
Nowhere does our disdain for this thing show.
Powered by blists - more mailing lists