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/