Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Processor cache

Name: Anonymous 2014-01-30 13:06

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: sage 2014-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: Anonymous 2014-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: Anonymous 2014-01-30 14:10

install BSD/Gentoo

Name: Anonymous 2014-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: Anonymous 2014-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.

Name: Anonymous 2014-01-30 19:51

>>4
Explain

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2014-01-30 21:04

They tried it in P3 and P4
http://software.intel.com/en-us/articles/use-software-data-prefetch-on-32-bit-intel-architecture

Then a few years later
https://lwn.net/Articles/444336/

And modern processors are Intelligent enough to not require any of this sort of thing anymore.

Name: Anonymous 2014-01-30 21:09

>>8
Why are you such an Intel fan Mrs. Atori?

Name: Anonymous 2014-01-30 21:30

>>9
Naked self interest.

Name: Anonymous 2014-01-30 22:05

>>9
He is a shill from Intel.

>>10
>le pedophile sage

Name: Anonymous 2014-01-31 5:58

>>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.

Name: Anonymous 2014-01-31 13:59

>>1,7-9-11,12
Who are you quoting?

Name: Anonymous 2014-01-31 14:34

its shit

Name: Anonymous 2014-01-31 14:38

arch linux

not even once

Name: Anonymous 2014-02-01 13:34

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.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2014-02-02 9:19

Name: Anonymous 2014-02-02 13:55

>>17
>le kike cache

Don't change these.
Name: Email:
Entire Thread Thread List