Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

CPU caches are used by exploiting temporal and spatial locality. My question is who is responsible for managing these caches? Is this Operating system that identifies a particular access pattern and then manages (i.e store the data in) cache, using low level OS function calls?

share|improve this question
    
If caches where managed by software, CPUs would not get anything done time-wise; also, wouldn't that be a catch 22? –  Raphael Feb 24 '13 at 16:09
add comment

3 Answers 3

up vote 3 down vote accepted

The CPU cache handles each and every access to memory, that is just too fast to be under software control. It is entirely built into the hardware, either on the CPU chip itself or on the motherboard.

share|improve this answer
add comment

The CPU caches are operational from the very moment on when the CPU is powered up. Neither the BIOS nor an OS are strictly speaking “necessary” to control the caches. The BIOS and the OS can change cache configuration settings in the CPU but they don’t control the normal operation, this is all built into the CPU itself.

share|improve this answer
add comment

It is totally depends on your hardware platform (For example Nios® II provides some instruction for managing caches). You should read the instruction and assembly language. Some processor provide you some instructions to manage cache in some level. for example WBINVD provides Write back and flush Internal caches; initiate writing-back and flushing of external caches (or INVD).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.