public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Jes Sorensen <jes@sgi.com>
Cc: Nick Piggin <npiggin@suse.de>,
	linux-arch@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [rfc] add io barriers, remove mmiowb
Date: Thu, 22 May 2008 09:34:07 -0700	[thread overview]
Message-ID: <200805220934.07871.jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <483566E7.8010703@sgi.com>

On Thursday, May 22, 2008 5:28 am Jes Sorensen wrote:
> Nick Piggin wrote:
> > Right, but probably the large majority of wmb() callers actually
> > just want io_wmb(). This would relieve much of the performance
> > problem, I'd say.
> >
> > Of those that really want a wmb() and cannot be converted to
> > io_wmb(), I don't think it is a good option to actually just weaken
> > wmb() because we deem that doing what the caller asked for is too
> > expensive.
>
> Hi Nick,
>
> I believe there's a fair number of places where wmb() is used for
> memory ordering not related to IO.
>
> > I guess with the ia64_mf(), Altix probably does not reorder PCI
> > stores past earlier cacheable stores, so _some_ wmb()s actually
> > do not require the full mmiowb case (if we only need to order
> > an earlier RAM store with a later PCI store). However, again,
> > weakening wmb() is not a good option because it really requires
> > an audit of the entire tree to do that.
>
> Nope, unfortunately not, ia64_mf() isn't strong enough to prevent the
> reordering, it's done in the PCI controller, so in order to guarantee
> the the reording you have to go all the way out to the PCI controller,
> which is very slow.

And more than that, the local PCI controller has to wait for any outstanding 
writes to arrive at the target host bridge.  That's why the operation is so 
expensive.

> > We _could_ introduce partial barriers like store/iostore iostore/store,
> > but really, I think the io_wmb is a pretty good first step, and I
> > haven't actually seen any numbers indicating it would be a performance
> > problem.
>
> I must admit I am not 100% upto speed on the entire discussion, but I
> think the io_wmb() and friends did go around in the past and got shot
> down.

To be fair to the ia64 guys who pushed this (me), I think the powerpc guys 
were supposed to introduce the other set of barriers they needed at around 
the same time, so we'd have the complete set.  I guess they never got around 
to it.

Given that core kernel code using wmb() usually doesn't care about I/O 
ordering, making it into a heavyweight operation might be a bad idea, 
especially if powerpc wants to weaken its wmb() operations eventually.

Is there really a conflict of definitions except for between ia64 and powerpc 
here?  IIRC they needed more types of barriers to speed things up, but never 
introduced them, and so had to make some of the existing barriers much more 
expensive than they would have liked...

Jesse

  reply	other threads:[~2008-05-22 16:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 15:28 [rfc] add io barriers, remove mmiowb Nick Piggin
2008-05-22  8:34 ` Jes Sorensen
2008-05-22  9:51   ` Nick Piggin
2008-05-22 12:28     ` Jes Sorensen
2008-05-22 16:34       ` Jesse Barnes [this message]
2008-05-23  1:44         ` Nick Piggin
2008-05-22 23:59       ` Paul Mackerras

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=200805220934.07871.jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=jes@sgi.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=npiggin@suse.de \
    --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