lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC][PATCH] mips: Fix arch_spin_unlock()
    From
    On Tue, Feb 2, 2016 at 4:02 AM, Paul E. McKenney
    <paulmck@linux.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

    \
     
     \ /
      Last update: 2016-02-02 19:21    [W:4.137 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site