From: "Albert Cahalan" <acahalan@gmail.com>
To: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Cc: jbarnes@virtuousgeek.org, alan@lxorguk.ukuu.org.uk,
davem@davemloft.net, jeff@garzik.org, paulus@samba.org,
torvalds@osdl.org, linux-kernel@vger.kernel.org, akpm@osdl.org,
segher@kernel.crashing.org
Subject: Re: Opinion on ordering of writel vs. stores to RAM
Date: Tue, 12 Sep 2006 03:09:46 -0400 [thread overview]
Message-ID: <787b0d920609120009q7b7bf47dw9d320e838cf191a@mail.gmail.com> (raw)
In-Reply-To: <1158041558.15465.77.camel@localhost.localdomain>
On 9/12/06, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > Oops, I forgot about store-store ordering being automatic.
> > Pretend I had some loads in my example.
>
> Well, in 99% of the cases, you want MMIO loads to be orderd vs. MMIO
> stores and thus you can use __writel and __readl (which will only do an
> eieio in __readl). If you are really that picky, then, of course you can
> go use the __raw_* versions.
If I could get the __raw_* versions for every arch, and there
wouldn't be any endianness troubles, it'd do.
I think a single or double "_" is enough warning to enable
full foot-shooting ability though.
> > A proper interface would be more explicit about what the
> > fence does, so that driver authors shouldn't need to know
> > this detail.
>
> What detail ? Isn't my document explicit enough ? If not, please let me
> know what is not clear in the definition of the 4 ordering rules and the
> matching fences.
The driver code is not very self-documenting this way.
If I see an io_to_io_barrier(), how am I to tell if it is
read to read, write to write, read to write, write to read,
read/write to read, read/write to write, read to read/write,
write to read/write, or read/write to read/write?
Considering just reads and writes to MMIO, there are
9 possible types of fence. SPARC seems to cover a
decent number of these distinctly; the instruction takes
an immediate value as flags.
> > So you say: never mix strict mappings with loose operations,
> > and never mix loose mappings with strict operations.
>
> I don't want the concept of "lose mappings" in the generic driver
> interface for now anyway :)
>
> It's too implementation specific and I want to know that a given access
> is strictly ordered or relaxed just by looking at the accessor used, not
> having to go look for where the driver did the ioremap. We can still
> provide arch specific things where we feel it's useful but let's move
> one step at a time with the generic accessors.
I suppose the "sparse" tool could match up mapping type
with accessor type. That'd let you rely on the accessor to
be doing what you expect when you read the code.
Loose mappings are only arch-specific in implementation.
Generic non-arch driver code ought to be able to take
advantage of the performance benefits of loose mappings.
(that is: full any-any reordering)
next prev parent reply other threads:[~2006-09-12 7:09 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 4:30 Albert Cahalan
2006-09-12 5:30 ` Benjamin Herrenschmidt
2006-09-12 6:04 ` Albert Cahalan
2006-09-12 6:12 ` Benjamin Herrenschmidt
2006-09-12 7:09 ` Albert Cahalan [this message]
2006-09-12 7:17 ` Benjamin Herrenschmidt
2006-09-12 7:21 ` Albert Cahalan
-- strict thread matches above, loose matches on Subject: below --
2006-09-11 5:03 Michael Chan
2006-09-11 5:21 ` Benjamin Herrenschmidt
2006-09-09 2:03 Paul Mackerras
2006-09-09 2:42 ` Linus Torvalds
2006-09-09 3:02 ` Paul Mackerras
2006-09-09 3:54 ` Linus Torvalds
2006-09-09 7:24 ` Benjamin Herrenschmidt
2006-09-09 9:34 ` David Miller
2006-09-09 9:55 ` Jeff Garzik
2006-09-09 10:08 ` David Miller
2006-09-10 17:18 ` Jesse Barnes
2006-09-10 19:35 ` Alan Cox
2006-09-10 21:25 ` Benjamin Herrenschmidt
2006-09-10 22:23 ` Alan Cox
2006-09-10 22:18 ` Benjamin Herrenschmidt
2006-09-11 13:19 ` Jes Sorensen
2006-09-10 23:35 ` Segher Boessenkool
2006-09-11 0:12 ` Benjamin Herrenschmidt
2006-09-11 0:34 ` Jesse Barnes
2006-09-11 1:04 ` Benjamin Herrenschmidt
2006-09-11 1:13 ` Segher Boessenkool
2006-09-11 1:35 ` Benjamin Herrenschmidt
2006-09-11 9:02 ` Alan Cox
2006-09-11 9:23 ` Benjamin Herrenschmidt
2006-09-11 0:25 ` Jesse Barnes
2006-09-11 0:54 ` Segher Boessenkool
2006-09-11 1:10 ` Benjamin Herrenschmidt
2006-09-11 1:48 ` Segher Boessenkool
2006-09-11 3:53 ` Benjamin Herrenschmidt
2006-09-11 18:12 ` Jesse Barnes
2006-09-11 1:00 ` Benjamin Herrenschmidt
2006-09-11 18:08 ` Jesse Barnes
2006-09-11 21:32 ` Benjamin Herrenschmidt
2006-09-10 20:01 ` Segher Boessenkool
2006-09-11 13:21 ` David Miller
2006-09-11 14:17 ` Segher Boessenkool
2006-09-12 0:32 ` David Miller
2006-09-12 0:49 ` Benjamin Herrenschmidt
2006-09-12 16:47 ` Segher Boessenkool
2006-09-12 0:54 ` Roland Dreier
2006-09-09 11:16 ` Paul Mackerras
2006-09-09 7:23 ` Benjamin Herrenschmidt
2006-09-09 9:38 ` David Miller
2006-09-09 15:09 ` Alan Cox
2006-09-10 17:19 ` Jesse Barnes
2006-09-10 17:35 ` Michael Buesch
2006-09-10 17:49 ` Linus Torvalds
2006-09-10 18:02 ` Michael Buesch
2006-09-09 15:08 ` Alan Cox
2006-09-09 18:34 ` Auke Kok
2006-09-09 19:10 ` Patrick McFarland
2006-09-09 15:06 ` Alan Cox
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=787b0d920609120009q7b7bf47dw9d320e838cf191a@mail.gmail.com \
--to=acahalan@gmail.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=jbarnes@virtuousgeek.org \
--cc=jeff@garzik.org \
--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
all inboxes | Powered by JetHome®