[lkml]   [2001]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Missing cache flush.
In article <>,
Chris Wedgwood <> 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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:54    [W:0.109 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site