Friday 17 May 2013

What is CPU cache ?

Many of us may wonder, what is the cache and why is it important ?

A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory.

In general :

L1 cache is physically next to the processing core and is implemented in SRAM, or Static RAM which is fast and constant when powered on. It does not require refresh cycles. It is generally split with half used for instruction code and the the other used for data.


L2 cache is physically close to the core, but is implemented in DRAM or Dynamic RAM and goes through refresh cycles many time a second to retain its memory. It is not as fast as L1 and cannot be accessed during refresh.


L3 cache has come into vogue with the advent of multi-core CPUs. Whereas these chips will have both L1 and L2 caches for each separate core; there is a common fairly large L3 shared by all cores. It is usually the size of all other caches combined or a few multiples of all other caches combined. It is also implemented in DRAM. One unusual thing is that a multi-core chip that is running software that may not be capable of or need all cores will have a core flush its caches into the L3 before that core goes dormant.



No comments:

Post a Comment