From: Nick Piggin <npiggin@suse.de>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [patch 1/2] powerpc: rmb fix
Date: Fri, 24 Aug 2007 04:47:23 +0200 [thread overview]
Message-ID: <20070824024723.GA6989@wotan.suse.de> (raw)
In-Reply-To: <7dc0bb83644f4cd44b4810a99d0003a1@kernel.crashing.org>
On Thu, Aug 23, 2007 at 07:57:20PM +0200, Segher Boessenkool wrote:
> >>The powerpc kernel needs to have full sync insns in every I/O
> >>accessor in order to enforce all the ordering rules Linux demands.
> >>It's a bloody shame, but the alternative would be to make the
> >>barriers lots more expensive. A third alternative would be to
> >
> >Well lots more expensive compared to what you have now. But what
> >you have now is like having those expensive barriers between
> >*every* io access.
>
> Yeah. But I/O reads are very expensive anyway, and the barriers
> are used for more than just I/O ordering.
rmb() should only be used when IO ordering matters. smp_rmb() is
for regular ordering.
So doesn't the fact IO reads are very expensive anyway lend more
weight _to have_ the full IO ordering in rmb()?
> I/O writes are a different thing; ideally, they would use only
> eieio, if anything at all.
For IO to IO ordering, yes eieio would be ideal. I don't know that
there is really such a primitive for that in Linux. io_wmb().
> Maybe the tradeoff isn't optimal. The I/O primitives didn't have
> all those "sync"s in there before, they got added because some bad
> interaction with spinlocks was discovered, if my memory isn't failing
> me.
I think it may have been because IO ops are pretty strongly ordered
on x86, and it was thought that a fair amount of code was relying on
that. So the old primitives were made quite strongly ordered, and
new ones were added to avoid the overhead. Unfortunately, you can't
actually use the unordered ones unless you have working barrier
instructions. Hence why I think rmb() should be an IO barrier.
But I'm not pushing this too hard. You guys all know the gory ppc
details better than I, so I'll just leave it with you to work out
whether it is the right thing to do.
> >>have barrier ops that do not order everything, but just A vs. B
> >>for various choices of A and B (coherent accesses, MMIO accesses,
> >>etc.)
> >
> >The non-smp_ variant is supposed to order everything, AFAIK. Maybe
> >you could get more fancy and have PIO vs MMIO etc etc. but it looks
> >like this whole area is in a pretty sticky state anyway so let's
> >not think about that.
>
> *Thinking* about it is fun. Trying to get the code merged would be
> a different thing ;-)
;)
next prev parent reply other threads:[~2007-08-24 2:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 2:11 [patch 1/2] powerpc: rmb fix Nick Piggin
2007-08-21 2:16 ` [patch 1/2] powerpc: smp_wmb speedup Nick Piggin
2007-08-21 2:21 ` Nick Piggin
2007-08-21 19:07 ` [patch 1/2] powerpc: rmb fix Joel Schopp
2007-08-21 19:43 ` Segher Boessenkool
2007-08-21 21:42 ` Linas Vepstas
2007-08-22 1:16 ` Nick Piggin
2007-08-22 3:29 ` Segher Boessenkool
2007-08-22 3:55 ` Nick Piggin
2007-08-23 17:57 ` Segher Boessenkool
2007-08-24 2:47 ` Nick Piggin [this message]
2007-08-22 3:15 ` Nick Piggin
2007-08-22 3:33 ` Segher Boessenkool
2007-08-22 4:05 ` Nick Piggin
2007-08-23 17:49 ` Segher Boessenkool
-- strict thread matches above, loose matches on Subject: below --
2008-05-21 14:10 Nick Piggin
2008-05-21 15:27 ` Benjamin Herrenschmidt
2008-05-21 15:32 ` Nick Piggin
2008-05-21 15:43 ` Benjamin Herrenschmidt
2008-05-23 2:14 ` Paul Mackerras
2008-05-23 4:40 ` Nick Piggin
2008-05-23 4:53 ` Paul Mackerras
2008-05-23 5:48 ` Nick Piggin
2008-05-23 6:40 ` Paul Mackerras
2008-05-26 1:38 ` Nick Piggin
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=20070824024723.GA6989@wotan.suse.de \
--to=npiggin@suse.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=segher@kernel.crashing.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).