Cache invalidation testing and reset

So, after programming, the basic procedures associated with the L1 and L2 cache in the Linux kernel ( arch/arm/mm/cache-X.S), for example, relate to the ARM11 processor, is there a test utility / program for checking the correct operation of the cache, so that the flash does not work correctly. How can we ensure this, and not just rely on our own programs.

+3
source share
3 answers

You can use the perfcounters subsystem. This is mainly an abstraction of processor performance counters, which are hardware registers that record events such as cache misses, executed instructions, incorrect industry predictions, etc. It also provides an abstraction for software events (sic) such as minor / major page errors, task migrations, switches, and trace points. perf tool can be used to control and verify the correct behavior of the cache - for example, you can check the correctness of work with clearing the cache by filling out caching, clearing, measuring cache misses during subsequent access to the memory and comparing it with the expected result.

+1
source

LMBench , linux ( x86, ARM9 CortexA8). .

0

If your cache uses RAM, you can clear Linux RAM:

echo "1" > /proc/sys/vm/drop_caches
echo "0" > /proc/sys/vm/drop_caches
free -m
0
source

All Articles