[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Feb 2016 09:56:14 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Paul McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Boqun Feng <boqun.feng@...il.com>,
Will Deacon <will.deacon@....com>,
Peter Zijlstra <peterz@...radead.org>,
"Maciej W. Rozycki" <macro@...tec.com>,
David Daney <ddaney@...iumnetworks.com>,
Måns Rullgård <mans@...sr.com>,
Ralf Baechle <ralf@...ux-mips.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] mips: Fix arch_spin_unlock()
On Tue, Feb 2, 2016 at 4:02 AM, Paul E. McKenney
<paulmck@...ux.vnet.ibm.com> wrote:
>
> The sorts of things I am really worried about are abominations like this
> (and far worse):
That one doesn't have any causal chain that I can see, so I agree that
it's an abomination, but it also doesn't act as an argument.
> r1 == 1 && r2 == 1 && c == 2 && r3 == 0 ???
What do you see as the problem here? The above can happen in a
strictly ordered situation: thread2 runs first (c == 2, r3 = 0), then
thread3 runs (d = 1, a = 1) then thread0 runs (r1 = 1) and then
thread1 starts running but the store to c doesn't complete (now r2 =
1).
So there's no reason for your case to not happen, but the real issue
is that there is no causal relationship that your example describes,
so it's not even interesting.
Causality breaking is what really screws with peoples minds. The
reason transitivity is important (and why smp_read_barrier_depends()
is so annoying) is because causal breaks make peoples minds twist in
bad ways.
Sadly, memory orderings are very seldom described as honoring
causality, and instead people have the crazy litmus tests.
Linus
Powered by blists - more mailing lists