From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
Nicolas Pitre <nico@marvell.com>,
Jamie Lokier <jamie@shareable.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"James E.J. Bottomley" <jejb@parisc-linux.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
"Shilimkar, Santosh" <santosh.shilimkar@ti.com>,
Andrew Morton <akpm@linux-foundation.org>,
Saeed Bishara <saeed@marvell.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: Rampant ext3/4 corruption on 2.6.34-rc7 with VIVT ARM (Marvell 88f5182)
Date: Fri, 14 May 2010 09:53:50 +1000 [thread overview]
Message-ID: <1273794830.21352.202.camel@pasglop> (raw)
In-Reply-To: <1273765193.4353.157.camel@mulgrave.site>
> > Well if the driver can peek at the data after the sync, and have any
> > kind of ordering guarantee that it doesn't get stale data (the load
> > isn't prefetched or speculated early), that would require an mb() or at
> > least rmb().
>
> So the guarantee that it doesn't look at stale data after the sync on a
> cache coherent machine means ordering the dma write to physical memory
> with the subsequent cpu read ... no memory barrier can actually do that.
> Usually this is done externally, by making sure the memory change is
> visible before sending the irq that tells the driver it is there ... on
> some numa systems, this can be a problem (hence the mmiowb/relaxed read
> thing).
Right. I was more thinking about something along the lines of the device
writes to some descriptor and then queues it up in a list. So we have
two different DMA data structures with a data dependency.
The question is whether the driver can expect to just do the sync, read
the queue, then sync again, then read the descriptor, or does it also
need an explicit rmb in between ?
Let's assume that the ordering is maintained at the DMA -> coherency
domain level, the question is will the sync op be guaranteed to toss
prefetch / speculative loads ? (IE. Guarantee the order of the two loads
done by the CPU) or do we need an explicit rmb.
> > It would seem sensible for drivers to assume that something like
> > dma_cache_sync_for_cpu() thus has the semantics of an rmb() at least,
> > no ?
>
> I still don't see why ... I don't see how you'd ever get a read of the
> area speculated before the event that tells the driver its OK to read
> the memory. In theory, I agree that it looks logical to require the
> read never be speculated before the sync ... but in practice, I don't
> see there ever being a problem with this since the sync isn't the event
> that says the memory is safe to read.
Cheers,
Ben.
> James
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2010-05-13 23:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 9:23 Rampant ext3/4 corruption on 2.6.34-rc7 with VIVT ARM (Marvell 88f5182) Benjamin Herrenschmidt
2010-05-11 10:16 ` Jamie Lokier
2010-05-11 10:47 ` Benjamin Herrenschmidt
2010-05-11 10:57 ` Benjamin Herrenschmidt
2010-05-11 11:14 ` Shilimkar, Santosh
2010-05-12 22:21 ` Jamie Lokier
2010-05-12 22:47 ` Benjamin Herrenschmidt
2010-05-12 23:08 ` Russell King - ARM Linux
2010-05-14 17:41 ` Jamie Lokier
2010-05-14 17:59 ` Russell King - ARM Linux
2010-05-12 23:41 ` James Bottomley
2010-05-13 0:18 ` Benjamin Herrenschmidt
2010-05-13 15:39 ` James Bottomley
2010-05-13 23:53 ` Benjamin Herrenschmidt [this message]
2010-05-13 3:12 ` FUJITA Tomonori
2010-05-13 4:42 ` Benjamin Herrenschmidt
2010-05-12 15:00 ` Jan Kara
2010-05-12 22:13 ` Benjamin Herrenschmidt
2010-05-13 0:15 ` Benjamin Herrenschmidt
2010-05-13 15:12 ` Jan Kara
2010-05-13 21:33 ` Benjamin Herrenschmidt
2010-05-13 23:51 ` 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=1273794830.21352.202.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jamie@shareable.org \
--cc=jejb@parisc-linux.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico@marvell.com \
--cc=saeed@marvell.com \
--cc=santosh.shilimkar@ti.com \
/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).