lkml.org 
[lkml]   [2019]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 01/20] asm-generic/mmiowb: Add generic implementation of mmiowb() tracking
    On Mon, Mar 4, 2019 at 4:21 PM Nicholas Piggin <npiggin@gmail.com> wrote:
    >
    > Well you don't have to talk about it but why do you want me to stop?
    > I don't understand. It's an open topic still after this series. I
    > can post a new thread about it if that would upset you less, I just
    > thought it would kind of fit here because we're talking about mmiowb,
    > I'm not trying to derail this series.

    Because if anybody is doing lockless programming with IO, they deserve
    whatever they get.

    In other words, the whole "wmb()" issue is basically not an issue.

    We already have rules like:

    - mmio is ordered wrt itself

    - mmio is ordered wrt previous memory ops (because of dma)

    and while it turned out that at least alpha had broken those rules at
    some point, and we had a discussion about it, that was just a bug.

    So there's basically no real reason to ever use "wmb()" with any of
    the normal mmio stuff.

    Now, we do have __raw_writel() etc, which are explicitly not ordered,
    but they also haven't been really standardized. And in fact, people
    who use them often seem to want to use them together with various weak
    memory remappings.

    And yes, "wmb()" has been the traditional way to order those, to the
    point where "wmb()" on x86 is actually a "sfence" because once you do
    IO on those kinds of unordered mappings, the usual SMP rules go out
    the window (a normal "smp_wmb()" is just a compiler barrier on x86).

    But notice how this is *entirely* independent of the spinlock issue,
    and has absolutely *nothing* to do with the whole mmiowb() thing that
    was always about "normal IO vs normal RAM" (due to the ia64 breakage).

    Linus

    \
     
     \ /
      Last update: 2019-03-05 01:34    [W:2.311 / U:0.224 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site