public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jeff Garzik <jgarzik@pobox.com>,
	Paul Mackerras <paulus@samba.org>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Subject: Re: [RFC] MMIO accessors & barriers documentation
Date: Wed, 13 Sep 2006 11:34:13 +1000	[thread overview]
Message-ID: <1158111253.3337.28.camel@localhost.localdomain> (raw)
In-Reply-To: <3F3A70F8-3DEE-4B1D-9C49-7A2EBC50156C@kernel.crashing.org>


> Please explain what drivers will need changes because of this.  Not just
> the few you really care about, but _all_ that could be plugged into  
> PowerPC
> machines' PCI busses, and might need changes because of changing the
> ordering semantics of readX()/writeX() from the supposed standard Linux
> semantics (i.e., the x86 semantics).

They won't. They will still work, and in some (many ?) case better due
to the removal of a potential bug since lots of driver don't have a
barrier where they should be with relaxed semantics. So the net effect
is positive here.

Now, it also means that we -can- start improving drivers we care about
to use the relaxed semantics and benefit from there. And since the
semantics are well defined, all archs with some sort of relaxed ordering
will be able to benefit in a way or another.

In addition, it will allow us to get a small optimisation on PowerPC vs.
the current situation by slightly relaxing wmb() which currently has to
do a full sync because it might be used to order memory vs. MMIO, which
it will no longer do (it will go back to a pure memory store barrier).

Anyway, Paul has a patch we are testing that makes our writel/readl's
synchronous (by moving the sync to before writel, adding an eieio before
readl, and doing the percpu trick so spin_unlock magically does a sync
when a writel occurred). With that, we'll get full correctness with no
more sync's in writel than we had before. We are running some benchs
here now to see what kind of performance impact it has overall, and if
we are happy, that can make it into 2.6.18 and close the problem of
drivers assuming ordered MMIO vs. memory at least.

Then, in a -separate- step, we can provide a set of relaxed accessors
that will allow for additional performance improvements on the hot path
of selected drivers.

I'm tired of arguing over and over again the same thing here anyway,
I'll post a new version of the document including some of the feedback
we got already and will submit it for inclusion along with a
__writel/__readl implementation for powerpc (and a generic one that
defaults to readl/writel) for the 2.6.19 timeframe.

We'll see from there if there are more constructive comments.

Ben.




  reply	other threads:[~2006-09-13  1:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-11  4:03 [RFC] MMIO accessors & barriers documentation Benjamin Herrenschmidt
2006-09-11  8:57 ` Alan Cox
2006-09-11  9:17   ` Benjamin Herrenschmidt
2006-09-11 10:07     ` Alan Cox
2006-09-11  9:59       ` Benjamin Herrenschmidt
2006-09-11 17:26         ` Alan Cox
2006-09-11 21:29           ` Benjamin Herrenschmidt
2006-09-12  5:48       ` Eric W. Biederman
2006-09-12  5:56         ` Benjamin Herrenschmidt
2006-09-12  6:27           ` Eric W. Biederman
2006-09-12  7:13             ` Benjamin Herrenschmidt
2006-09-12 15:19               ` Segher Boessenkool
2006-09-12 21:22                 ` Benjamin Herrenschmidt
2006-09-13  0:12                   ` Segher Boessenkool
2006-09-13  1:34                     ` Benjamin Herrenschmidt [this message]
2006-09-11 18:39 ` Jesse Barnes
2006-09-11 21:45   ` Benjamin Herrenschmidt
2006-09-11 21:54     ` Jeff Garzik
2006-09-11 22:56       ` Benjamin Herrenschmidt
2006-09-11 23:08         ` Roland Dreier
2006-09-11 23:18           ` Benjamin Herrenschmidt
2006-09-11 23:24         ` Jeff Garzik
2006-09-12  0:46           ` Benjamin Herrenschmidt
2006-09-12 15:32           ` Segher Boessenkool
2006-09-11 22:05     ` Jesse Barnes
2006-09-11 23:01       ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2006-09-12  5:33 Albert Cahalan
2006-09-12  5:48 ` 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=1158111253.3337.28.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=segher@kernel.crashing.org \
    --cc=torvalds@osdl.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