From: Jack Steiner <steiner@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: cacheble to uncachble change
Date: Tue, 27 Apr 2004 21:31:57 +0000 [thread overview]
Message-ID: <20040427213157.GA8270@sgi.com> (raw)
In-Reply-To: <408D5C58.E07A5FBE@email.mot.com>
On Tue, Apr 27, 2004 at 12:50:16PM -0700, David Mosberger wrote:
> >>>>> On Tue, 27 Apr 2004 09:24:41 -0500, Jack Steiner <steiner@sgi.com> said:
>
> Jack> On Tue, Apr 27, 2004 at 05:52:28AM -0500, Robin Holt wrote:
> >> On Mon, Apr 26, 2004 at 05:03:23PM -0700, David Mosberger wrote:
> >> > >>>>> On Mon, 26 Apr 2004 16:35:55 -0500, Robin Holt <holt@sgi.com> said:
> >> > Are you just re-stating my caveat about memory-attribute-aliasing or
> >> > are you saying something else? If the latter, I'm not following. If
> >> > the former, I certainly agree: memory attribute-aliasing leads to
> >> > really nasty-to-track-down bugs. Hence, you want to make sure
> >> > _upfront_ that it doesn't occur.
>
> >> Restating. Don't you love the person who plays the master of the obvious
> >> role. I started writing the email and was at the same time looking for
> >> examples of kernel code from 2.4 which we had found that was speculating
>
> Jack> IIRC, one place that got us in trouble in 2.4 was in
> Jack> free_one_pgd(). The code prefetches a dirty cacheline that is
> Jack> one cache line BEYOND the end of the PT page. The line is
> Jack> marked dirty (prefetchw()) in the cache even though the
> Jack> function does not actually modify it. The line will
> Jack> subsequently be written back to memory. If the following page
> Jack> is in the same granule & is being used uncached
> Jack> (memory-attribute-aliasing), bad things will happen......
>
> Yes, of course. Violating a correctness requirement (no
> memory-attribute aliasing) can cause bad things to happen. Duh.
Maybe I was not clear. I *know* that memory attribute aliasing is a bad
thing to do. I was commenting on Robin's mail and providing a real-life
example on where/how it causes problems. Prefetching is a perfectly
valid thing for the cpu to do. Any time there is a valid TLB entry, prefetching
can & will happen. DONT allow a TLB entry to cover both cached &
uncached pages.
>
> I don't mean this as a criticism. I only want to be clear that the
> bug here was caused by ignoring a correctness requirement ("no
> attribute aliasing"). The kernel is perfectly entitled to prefetch
> any address of its choosing. In fact, even without explicit data
> prefetches, you'll get implicit code prefetching (not to mention
> speculative loads when using a modern compiler).
>
> The moral of the story: we're not kidding when we say memory-attribute
> aliasing needs to be taken seriously. (And it's not an ia64-only
> concern, as the nasty AGP-related attribute-aliasing bug revealed on
> Linux for certain x86 CPUs.)
>
> --david
--
Thanks
Jack Steiner (steiner@sgi.com) 651-683-5302
Principal Engineer SGI - Silicon Graphics, Inc.
next prev parent reply other threads:[~2004-04-27 21:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-26 18:57 cacheble to uncachble change Mario Smarduch
2004-04-26 19:25 ` David Mosberger
2004-04-26 21:24 ` Jim Hull
2004-04-26 21:35 ` Robin Holt
2004-04-26 21:46 ` David Mosberger
2004-04-27 0:03 ` David Mosberger
2004-04-27 10:52 ` Robin Holt
2004-04-27 14:24 ` Jack Steiner
2004-04-27 19:50 ` David Mosberger
2004-04-27 21:31 ` Jack Steiner [this message]
2004-04-27 21:48 ` David Mosberger
2004-04-27 22:35 ` Mario Smarduch
2004-04-27 22:45 ` David Mosberger
2004-04-27 23:53 ` Luck, Tony
2004-04-28 1:43 ` Robin Holt
2004-04-28 15:52 ` Mario Smarduch
2004-04-29 4:49 ` David Mosberger
2004-04-29 13:39 ` Smarduch Mario-CMS063
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=20040427213157.GA8270@sgi.com \
--to=steiner@sgi.com \
--cc=linux-ia64@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.