Memory Basics
All systems have a memory hierarchy with memory at different speeds and sizes
at different points in the hierarchy. The fastest memory is known as
cache memory and is what it sounds like – memory that is used to temporarily hold, or
cache, contents of the main memory.
This sort of memory is very fast but expensive, therefore most processors have
a small amount of on-chip cache memory and more system based (on-board) cache memory.
Some processors have one cache to contain both instructions and data, but others have two,
one for instructions and the other for data. The Alpha AXP processor has two internal
memory caches; one for data (the D-Cache) and one for instructions (the I-Cache).
The external cache (or B-Cache) mixes the two together.
Finally there is the main memory which, relative to the external cache memory,
is very slow.
Relative to the on-
CPU cache, main memory is positively crawling.
The cache and main memories must be kept in step (coherent).
In other words, if a word of main memory is held in one or more locations
in cache, then the system must make sure that the contents of cache and
memory are the same. The job of cache coherency is done partially by the
hardware and partially by the operating system.
This is also true for a number of major system tasks where the hardware and software
must cooperate closely to achieve their aims.
Details on memory in general can be found here.
Details on cache memory can be found here.