Hi /prog/,
The people who write high-perforance stuff must use a lot of tricks like putting the data in a continuous chunk of memory and splitting your program by what is done with your data instead of what is your data. Now, all these tricks are used to make sure you don't get a cache miss, but couldn't they be considered premature optimization?
What if the cpu let us specify what should be put in its cache; then compilers could automatically manage this, and people who needs extreme performance would have more control over the cache.
Thanks
Name:
sage2014-01-30 13:08
I want to know if there is an obvious reason why we are not allowed to put data manually in the cache*
Name:
Anonymous2014-01-30 13:26
>>2
Becuase shitprograms would steal each other cache. Or single programs hogs all the cache.
You can use the latter if you have cache-as-ram, and you can prefetch chunks, but giving control to user programs is idiotic.
Name:
Anonymous2014-01-30 14:10
install BSD/Gentoo
Name:
Anonymous2014-01-30 14:59
>>3
this would be a ressource like any other; the OS could manage the access to the cache if we had control over it. We could then use system calls to ask for the cache, and the highest priority process would get it.
Name:
Anonymous2014-01-30 16:24
>>1
It's called learning how to know when to use the disassembler and when and how to write machine code.
>>8
No they aren't : as I said in OP, you gotta do all kind of optimization tricks to "trick" the CPU in keeping the data you want in the cache. >>6
Even if you wrote in machine code, you wouldn't be able to tell the CPU what to put in its cache on modern processors.
There's prefetch instruction for pulling data into the cache, there's streaming instructions to prevent data from being put into the cache, and some systems allow you to lock part of the cache to prevent data from being evicted.