We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm measuring worst case execution time of an application. I would like to flush L1, L2 (Instruction and Data) cache and then begin my measurements.
Is it doable from user mode?
Processor: ARM Cortex A9
OS: Linaro Linux
Hello,
Please let me know for my information.
Why do you need to manage caches in the user mode?
I think user applications need not to care of the cache behaviors.
Best regards,
Yasuhiko Koumoto.
Dear Yasuhiko Koumoto,
Difference in execution time are huge during consecutive runs (78ms, 52ms,...).
I believe flushing cache before each run will make it more deterministic.
I can randomly read/write huge data to clear cache contents. But OS may allocate a region of cache space for this operation and thus not clearing all the data in the cache.
Alternatively, measuring maximum value of 'n' runs would make sense to worst case execution time.
I wonder if there is a clean way to bring the execution time more deterministic.
Update:
I found GCC function __builtin___clear_cache(); that flushes only the instruction cache.