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 07:22:05 +1000 [thread overview]
Message-ID: <1158096125.3337.14.camel@localhost.localdomain> (raw)
In-Reply-To: <8A2F9DF4-1A17-454C-8243-8F86CF04F763@kernel.crashing.org>
> Or you do the sane thing and just not allow two threads of execution
> access to the same I/O device at the same time.
Why ? Some devices are designed to be able to handle that...
> Now compare this with the similar scenario for "normal" MMIO, where
> we do store;sync (or sync;store or even sync;store;sync) for every
> writel() -- exactly the same problem.
What problem ? "Normal" MMIO doesn't get combined, thus there is no
problem. Of course there is no guarantee of ordering of the stores from
the 2 CPUs unless there is a spinlock etc etc... but we are talking
about a case where that is acceptable here. Howver, combining is not.
> Better lock at a higher level than just per instruction.
>
> Some devices that want to support multiple clients at the same time
> have multiple identical "register files", one for each client, to
> prevent this and other problems (and it's useful anyway).
Yes, they do, and what happen if those register "files" happen to be
consecutive in the address space and the CPU suddenly combines a store
to the last register of one "file" and an unrelated store from another
thread to the first register of the other ?
This is a very specific problem that has nothing to do with your "grand
general case" which means that at least on Cell, you cannot use explicit
barriers to guarantee the absence of write combining. That's as simple
as that. All I need to figure out now is if that problem is specific to
one CPU implementation or more general, in which case, we'll have to
figure out some way to provide an interface.
> > Anyway, let's not pollute this discussion with that too much now :)
>
> Au contraire -- if you're proposing to hugely invasively change some
> core interface, and add millions of little barriers(*), you better
> explain how this is going to help us tackle the problems (like WC) that
> we are starting to see already, and that will be a big deal in the
> near future.
No, this is totally irrelevant. I'm proposing a simple change (nothing
invasive there) to the MMIO accessors of weakly ordered platforms only,
to make them guarantee ordering like x86 etc... and I'm proposing the
-addition- (which is not something I would cause invasive) of -one-
class of partially relaxed accessors and the -few- (damn, there are only
4 of them) barriers that precisely match the semantics that drivers
need. Oh, and make sure those semantics are well defined or they are
useless.
This has strictly nothing to do with WC and mixing things up will only
confuse the discussion and guarantee that we'll never get anything done.
<snip useless digression>
Ben.
next prev parent reply other threads:[~2006-09-12 21:23 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 [this message]
2006-09-13 0:12 ` Segher Boessenkool
2006-09-13 1:34 ` Benjamin Herrenschmidt
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=1158096125.3337.14.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