But... I don't _want_ it to work right!!
February 1, 2008 12:40 PM
Subscribe
Linux Hackers... help me make my linux box perform very very poorly on command.
OK, so for various reasons ( a research project) I want to be able to force the memory system to behave very very badly. I want to be able to force a cache-miss, or a TLB miss, or even force a page-fault disk read. So... I found a set of linux hooks in the kernel that would let me do this (ie flush_tlb()) but obviously they need to be run in kernel mode. So... I thought about writing a device driver to make the calls but I'm pretty sure even the driver wouldn't have permission to write to the CR registers (which is how the cache/TLB/ etc. flushes are done under the covers in x86).
I've never written a driver before and I don't want to go to the trouble just to find out it doesn't work. But a driver seems best since I want to write a variety of programs which could force this behavior whenever they want. So, hive mind any ideas? How can I make the memory hierarchy and virtual memory system break down on command?
==
PS I considered doing things like looking up the size and associativity of the caches and then forcing a cache miss but things like the victim cache and pre-fetcher make this approach difficult; to say nothing for how I would accomplish the same think at the page level.
posted by lucasks to computers & internet (5 comments total)
3 users marked this as a favorite
grabgig 4to have it allocate 4 gig of RAM.
posted by veedubya at 12:52 PM on February 1