Re: Perform minimal RAM test at boot

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 2 Nov 1999 18:12:03 +0100


Anton Ivanov wrote:
> > Adding a single `wbinvd' instruction at the right place is a simple
> > instruction that would actually work *according to the official docs* :-)
>
> But it is likely to slow down boot quite a bit. So if real cache invalidation
> is involved I would suggest that this be a boot parameter. You do not really
> need to do this unless you install, add hardware or are supsicious that bad
> things are happening.

I was making the point that Richard's code, though it works on many
processors, will not work on all.

The efficient way to do this kind of test involves turning off caching
data accesses for the test, but keep the cache on for the code.
PAGE_PCD can be used, and there are other mechanisms (though perhaps
less portable).

This may actually be faster than not disabling the data cache: it
prevents the memory accesses from doing a write-allocate line fill.

Total time is small. Assume ~100ns per uncached memory read (that's
pessimistic for most systems), and assume write time is relatively fast.
Multiply by 131,072 for a 128MB machine with tests at a 1k stride.

Total time: 13.1 milliseconds. No big deal.

enjoy,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/