[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFx0mYrxvMfngTY_+=-Ty2mOwoOuW9pLcLGUFmfP=rPvGQ@mail.gmail.com>
Date: Wed, 25 May 2016 09:54:55 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Waiman Long <waiman.long@....com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Manfred Spraul <manfred@...orfullife.com>,
Davidlohr Bueso <dave@...olabs.net>,
Will Deacon <will.deacon@....com>,
Boqun Feng <boqun.feng@...il.com>, Tejun Heo <tj@...nel.org>,
Pablo Neira Ayuso <pablo@...filter.org>,
Patrick McHardy <kaber@...sh.net>,
David Miller <davem@...emloft.net>,
Oleg Nesterov <oleg@...hat.com>,
netfilter-devel@...r.kernel.org,
Sasha Levin <sasha.levin@...cle.com>, hofrat@...dl.org
Subject: Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep
On Wed, May 25, 2016 at 9:28 AM, Peter Zijlstra <peterz@...radead.org> wrote:
>
> I would consider any architecture that allows speculative stores as
> broken. They are values out of thin air and would make any kind of
> concurrency extremely 'interesting'.
It's worth noting that the same is true of compilers too. You will
find compiler people who argue that speculative stores are valid
because the spec doesn't explicitly forbid them. Same is true of
compiler-generated value speculation.
Both are cases of "yeah, the C standard may not explicitly disallow
it, but sanity in a threaded environment does". Sadly, I've seen
compiler people who dismiss "sanity" as an argument, since that also
isn't defined in the C standard. There are people who think that paper
is the most precious resource in the universe.
I'm not actually aware of anybody doing speculative stores or value
speculation in a compiler we care about, but if those kinds of things
are the kinds of things where we'd just go "that compiler is shit" and
not use it (possibly with a command line option to disable the
particular broken optimization, like we do for the broken type-based
aliasing and some other code generation things that just don't work in
the kernel).
So we definitely have the option to just say "theory is just theory".
We'll never make design decisions based on insane things being
possible in theory, whether it be crazy architectures or crazy
compilers.
Linus
Powered by blists - more mailing lists