linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-ia64@vger.kernel.org, Jesse Barnes <jesse.barnes@intel.com>,
	linuxppc-dev@ozlabs.org
Subject: Re: wmb vs mmiowb
Date: Fri, 24 Aug 2007 04:59:16 +0200	[thread overview]
Message-ID: <20070824025916.GB6989@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.0.999.0708230915000.30176@woody.linux-foundation.org>

On Thu, Aug 23, 2007 at 09:16:42AM -0700, Linus Torvalds wrote:
> 
> 
> On Thu, 23 Aug 2007, Nick Piggin wrote:
> > 
> > Also, FWIW, there are some advantages of deferring the mmiowb thingy
> > until the point of unlock.
> 
> And that is exactly what ppc64 does.
> 
> But you're missing a big point: for 99.9% of all hardware, mmiowb() is a 
> total no-op. So when you talk about "advantages", you're not talking about 
> any *real* advantage, are you?

You're in a feisty mood today ;)

I guess on the 0.1% of hradware where it is not a noop, there might be a
real advantage... but that was just handwaving anyway. My real point was
that I'd like things to be more easily understandable.

I think we are agreed at this point that mmiowb without some form of CPU
synchronisation is a bug, and it is also not of the same type of barrier
that we normally think about in the kernel (it could be like a MPI style
rendezvous barrier between the CPU and the IO fabric). Anyway, point is
that device drivers seem to have enough on their plate already.

Look at bcm43xx, for example. Most of this guy's mmiowb()s are completely
wrong and should be wmb(). mmiowb() is only a wmb() on ppc because as I
said, ppc's spin_unlock does not order IOs like most other architectures.
On alpha, for example, spin_unlock does order IOs, so mmiowb is a noop,
and this is broken (non-sn2 ia64 should also be a noop here, because
their unlock orders IOs, but it seems that mmiowb semantics are so non
obvious that they either got it wrong themselves, or assumed device
drivers surely would).

  parent reply	other threads:[~2007-08-24  2:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22  4:57 wmb vs mmiowb Nick Piggin
2007-08-22 18:07 ` Linus Torvalds
2007-08-22 19:02   ` Jesse Barnes
2007-08-23  2:20     ` Nick Piggin
2007-08-23  2:57       ` Linus Torvalds
2007-08-23  3:54         ` Nick Piggin
2007-08-23 16:14           ` Linus Torvalds
2007-08-23  4:20         ` Nick Piggin
2007-08-23 16:16           ` Linus Torvalds
2007-08-23 16:27             ` Benjamin Herrenschmidt
2007-08-24  3:09               ` Nick Piggin
2007-08-28 20:56                 ` Brent Casavant
2007-08-29  0:59                   ` Nick Piggin
2007-08-29 18:53                     ` Brent Casavant
2007-08-30  3:36                       ` Nick Piggin
2007-08-30 19:42                         ` Brent Casavant
2007-09-03 20:48                           ` Nick Piggin
2007-08-24  2:59             ` Nick Piggin [this message]
2007-08-23 17:02       ` Jesse Barnes
2007-08-23  1:59   ` Nick Piggin
2007-08-23  7:27   ` Benjamin Herrenschmidt
2007-08-23 16:56     ` Jesse Barnes
2007-08-24  3:12       ` Nick Piggin
2007-08-28 21:21       ` Brent Casavant
2007-08-28 23:01         ` Peter Chubb
2007-08-23  7:25 ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070824025916.GB6989@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=jesse.barnes@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).