From: Paul Mackerras <paulus@samba.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: David Howells <dhowells@redhat.com>,
akpm@osdl.org, linux-arch@vger.kernel.org, bcrl@linux.intel.com,
matthew@wil.cx, linux-kernel@vger.kernel.org, mingo@redhat.com,
linuxppc64-dev@ozlabs.org, jblunck@suse.de
Subject: Re: Memory barriers and spin_unlock safety
Date: Wed, 8 Mar 2006 14:20:57 +1100 [thread overview]
Message-ID: <17422.19865.635112.820824@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0603040914160.22647@g5.osdl.org>
Linus Torvalds writes:
> So the rules from the PC side (and like it or not, they end up being
> what all the drivers are tested with) are:
>
> - regular stores are ordered by write barriers
I thought regular stores were always ordered anyway?
> - PIO stores are always synchronous
By synchronous, do you mean ordered with respect to all other accesses
(regular memory, MMIO, prefetchable MMIO, PIO)?
In other words, if I store a value in regular memory, then do an
outb() to a device, and the device does a DMA read to the location I
just stored to, is the device guaranteed to see the value I just
stored (assuming no other later store to the location)?
> - MMIO stores are ordered by IO semantics
> - PCI ordering must be honored:
> * write combining is only allowed on PCI memory resources
> that are marked prefetchable. If your host bridge does write
> combining in general, it's not a "host bridge", it's a "host
> disaster".
Presumably the host bridge doesn't know what sort of PCI resource is
mapped at a given address, so that information (whether the resource
is prefetchable) must come from the CPU, which would get it from the
TLB entry or an MTRR entry - is that right?
Or is there some gentleman's agreement between the host bridge and the
BIOS that certain address ranges are only used for certain types of
PCI memory resources?
> * for others, writes can always be posted, but they cannot
> be re-ordered wrt either reads or writes to that device
> (ie a read will always be fully synchronizing)
> - io_wmb must be honored
What ordering is there between stores to regular memory and stores to
non-prefetchable MMIO?
If a store to regular memory can be performed before a store to MMIO,
does a wmb() suffice to enforce an ordering, or do you have to use
mmiowb()?
Do PCs ever use write-through caching on prefetchable MMIO resources?
Thanks,
Paul.
next prev parent reply other threads:[~2006-03-08 3:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-03 16:03 David Howells
2006-03-03 16:45 ` David Howells
2006-03-03 17:03 ` Linus Torvalds
2006-03-06 9:06 ` Helge Hafting
2006-03-03 20:02 ` Arjan van de Ven
2006-03-03 20:17 ` David Howells
2006-03-03 21:34 ` Linus Torvalds
2006-03-03 21:51 ` Benjamin LaHaise
2006-03-03 22:21 ` Linus Torvalds
2006-03-03 22:36 ` Linus Torvalds
2006-03-07 17:36 ` David Howells
2006-03-07 17:40 ` Matthew Wilcox
2006-03-07 17:56 ` Jesse Barnes
2006-03-07 18:18 ` Alan Cox
2006-03-07 18:28 ` Linus Torvalds
2006-03-07 18:55 ` Alan Cox
2006-03-07 20:21 ` Linus Torvalds
2006-03-03 16:55 ` Linus Torvalds
2006-03-03 21:06 ` Benjamin Herrenschmidt
2006-03-03 21:18 ` Hollis Blanchard
2006-03-03 21:52 ` David S. Miller
2006-03-03 22:04 ` Linus Torvalds
2006-03-04 10:58 ` Paul Mackerras
2006-03-04 22:49 ` Benjamin Herrenschmidt
2006-03-04 10:58 ` Paul Mackerras
2006-03-04 17:28 ` Linus Torvalds
2006-03-08 3:20 ` Paul Mackerras [this message]
2006-03-08 3:54 ` Linus Torvalds
2006-03-08 13:12 ` Alan Cox
2006-03-08 15:30 ` Linus Torvalds
2006-03-05 2:04 ` Michael Buesch
2006-03-03 20:15 ` David Howells
2006-03-03 21:31 ` Linus Torvalds
[not found] <5Ml19-2Ki-19@gated-at.bofh.it>
[not found] ` <5MlO0-3JU-13@gated-at.bofh.it>
[not found] ` <5MCF0-2TS-27@gated-at.bofh.it>
[not found] ` <5MITJ-2l4-15@gated-at.bofh.it>
[not found] ` <5NXxl-6WZ-9@gated-at.bofh.it>
[not found] ` <5NY0h-7wa-1@gated-at.bofh.it>
2006-03-11 1:19 ` Robert Hancock
2006-03-12 18:09 ` 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=17422.19865.635112.820824@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=akpm@osdl.org \
--cc=bcrl@linux.intel.com \
--cc=dhowells@redhat.com \
--cc=jblunck@suse.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=matthew@wil.cx \
--cc=mingo@redhat.com \
--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®