From: Russell King <rmk@arm.linux.org.uk>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>,
linux-arch@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
davej@codemonkey.org.uk
Subject: Re: [CFT] read+shared mmap write+read data corruption
Date: Tue, 29 May 2007 18:13:57 +0100 [thread overview]
Message-ID: <20070529171357.GA18216@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1180449136.3700.6.camel@mulgrave.il.steeleye.com>
On Tue, May 29, 2007 at 09:32:16AM -0500, James Bottomley wrote:
> I agree its likely a stale kernel cache ... but the symptoms could be
> dirty user cache as well ... I was just trying to verify beyond doubt
> that it's the former.
If that were true, with a VIVT cache you'd have userspace randomly
SEGVing since stale data would leak through when things get remapped
(eg, objects which are only loaded for a short time) etc.
That isn't the case.
> > Flushing the kernel direct mapping by unconditionally calling
> > flush_dcache_page() in do_generic_mapping_read() makes the issue go
> > away and makes fsx-linux happy.
> >
> > Flushing the kernel direct mapping by forcibly context switching
> > between munmap() and read() (VIVT cache, context switch does full
> > cache flush+invalidate) makes the issue go away, too.
>
> I'm not that familiar with the mechanics of a VIVT cache. If you unmap,
> and thus remove the page table entries, does that mean a dirty VIVT line
> at those entries gets discarded if the processor can't find a mapping?
> Or does the TLB pin entries for dirty cache lines until they're flushed?
We _always_ write out data from the cache for the range we're going to
unmap with VIVT.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
next prev parent reply other threads:[~2007-05-29 17:14 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-27 10:49 [CFT] read+shared mmap write+read data corruption Russell King
2007-05-27 14:16 ` James Bottomley
2007-05-27 22:25 ` Lennert Buytenhek
2007-05-27 23:06 ` David Miller
2007-05-27 23:05 ` David Miller
2007-05-28 0:31 ` James Bottomley
2007-05-28 12:44 ` Lennert Buytenhek
2007-05-29 5:35 ` David Miller
2007-05-29 9:12 ` Russell King
2007-05-29 10:26 ` David Miller
2007-05-27 22:24 ` Lennert Buytenhek
2007-05-28 0:00 ` James Bottomley
2007-05-28 10:05 ` Russell King
2007-05-28 14:17 ` James Bottomley
2007-05-28 14:39 ` Lennert Buytenhek
2007-05-29 3:06 ` James Bottomley
2007-05-29 3:15 ` Lennert Buytenhek
2007-05-29 14:32 ` James Bottomley
2007-05-29 17:13 ` Russell King [this message]
2007-05-29 5:58 ` David Miller
2007-05-28 15:04 ` Russell King
2007-05-29 15:42 ` Lennert Buytenhek
2007-05-28 12:33 ` Lennert Buytenhek
2007-05-28 14:22 ` James Bottomley
2007-05-28 12:38 ` Lennert Buytenhek
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=20070529171357.GA18216@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=James.Bottomley@steeleye.com \
--cc=akpm@linux-foundation.org \
--cc=buytenh@wantstofly.org \
--cc=davej@codemonkey.org.uk \
--cc=linux-arch@vger.kernel.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