From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: Missing cache flush.
Date: 4 Jun 2001 22:28:19 -0700 [thread overview]
Message-ID: <9fhqlj$7jt$1@penguin.transmeta.com> (raw)
In-Reply-To: <13942.991696607@redhat.com> <3B1C1872.8D8F1529@mandrakesoft.com> <15132.15829.322534.88410@pizda.ninka.net> <20010605155550.C22741@metastasis.f00f.org>
In article <20010605155550.C22741@metastasis.f00f.org>,
Chris Wedgwood <cw@f00f.org> wrote:
>On Mon, Jun 04, 2001 at 07:03:01PM -0700, David S. Miller wrote:
>
> The x86 doesn't have dumb caches, therefore it really doesn't
> need to flush anything. Maybe a mb(), but that is it.
>
>What if the memory is erased underneath the CPU being aware of this?
>In such a way ig generates to bus traffic...
Doing bank switching etc is outside the scope of the current DMA cache
flush macros - they are there only for "sane" cache coherency issues,
not to be used as generic "we have to flush the cache because we went
behind the back of the CPU and switched a bank of memory around".
You will have to come up with some new primitive for this.
The x86 has the "wbinval" instruction, although it should be noted that
- it is buggy and will lock up some CPU's. Use with EXTREME CAUTION.
Intel set a special field in the MP table for whether wbinval is
usable or not, and you can probably find their errata on which CPU's
it doesn't work on (I think it was some early PPro steppings).
When wbinval doesn't work, there's another strategy to flush the
cache, but I forget what it was. It was something ridiculous like
reading in a few megabytes of memory from consecutive physical
addresses to make sure that the cache has been replaced.
- even when it works, it is necessarily very very very slow. Not to be
used lightly. As you can imagine, the work-around is even slower.
On the whole, I would suggest avoiding this like the plague, and just
marking such memory to be non-cacheable, regardless of whether there is
a performance impact or not. If you mark it write-combining and
speculative, it's going to perform a bit better.
Linus
next prev parent reply other threads:[~2001-06-05 5:29 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-04 23:16 Missing cache flush David Woodhouse
2001-06-04 23:23 ` Jeff Garzik
2001-06-04 23:29 ` David Woodhouse
2001-06-04 23:29 ` David Woodhouse
2001-06-05 2:04 ` David S. Miller
2001-06-05 2:04 ` David S. Miller
2001-06-05 2:03 ` David S. Miller
2001-06-05 2:03 ` David S. Miller
2001-06-05 3:55 ` Chris Wedgwood
2001-06-05 4:01 ` David S. Miller
2001-06-05 4:01 ` David S. Miller
2001-06-05 8:46 ` David Woodhouse
2001-06-05 8:46 ` David Woodhouse
2001-06-05 8:50 ` David S. Miller
2001-06-05 8:50 ` David S. Miller
2001-06-05 9:05 ` David Woodhouse
2001-06-05 9:05 ` David Woodhouse
2001-06-05 9:11 ` David S. Miller
2001-06-05 9:11 ` David S. Miller
2001-06-05 12:42 ` David Woodhouse
2001-06-05 12:42 ` David Woodhouse
2001-06-05 12:48 ` David S. Miller
2001-06-05 12:48 ` David S. Miller
2001-06-05 12:52 ` David Woodhouse
2001-06-05 12:52 ` David Woodhouse
2001-06-06 8:32 ` Albert D. Cahalan
2001-06-06 19:48 ` Pavel Machek
2001-06-05 17:01 ` Jamie Lokier
2001-06-05 23:24 ` Chris Wedgwood
2001-06-06 8:43 ` James Sutherland
2001-06-05 9:29 ` kira brown
2001-06-05 9:29 ` kira brown
2001-06-05 17:16 ` Alan Cox
2001-06-06 19:44 ` Earyly Cyrix CPUs was " Pavel Machek
2001-06-08 16:00 ` Alan Cox
2001-06-05 9:43 ` Johan Adolfsson
2001-06-05 5:28 ` Linus Torvalds [this message]
2001-06-05 6:49 ` Alan Cox
2001-06-05 8:29 ` Ingo Molnar
2001-06-05 15:10 ` Ralf Baechle
2001-06-05 9:17 ` Bjorn Wesen
2001-06-05 12:57 ` Chris Wedgwood
2001-06-05 15:17 ` Ralf Baechle
2001-06-05 17:41 ` Daniel Phillips
2001-06-05 14:22 ` Vipin Malik
2001-06-05 14:40 ` Chris Wedgwood
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='9fhqlj$7jt$1@penguin.transmeta.com' \
--to=torvalds@transmeta.com \
--cc=linux-kernel@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.