Professional Documents
Culture Documents
&
COMPUTER ARCHITECTURE
14CS253 / UE14CS253
UNIT-4
Session 6 & 7
CACHE
PERFORMANCE
CACHE PERFORMANCE
CACHE PERFORMANCE-
Average memory
access time
CACHE PERFORMANCE
EXAMPLE 2
Assume that the cache miss penalty is 200 clock cycles, and all
instructions normally take 1.0 clock cycles (ignoring memory stalls).
Assume that the average miss rate is 2%, there is an average of 1.5
memory references per instruction, and the average number of cache
misses per 1000 instructions is 30. What is the impact on performance
when behavior of the cache is included? Calculate the impact using both
misses per instruction and miss rate.
Ans: CPUtime = IC x [ CPI execution + Memory stall clock cycles ] x
Clock cycle time
instruction
The performance, including cache misses, is
CPU time
with Cache
The clock cycle time and instruction count are the same, with or
without a cache.
Thus CPU time increases sevenfold, with CPI from 1.00 for a perfect
cache to 7.00 cache that can miss.
CACHE OPTIMIZATIONS
The equation,
Average memory access time = Hit time + Miss
rate x Miss penalty.
Gives a frame work to present cache optimizations for
improving cache performance:
Hence, six basic cache optimizations can be organized
into three categories.
Reducing the miss rate
Larger block size, Larger cache size, and higher
associativity.
Reducing the miss penalty
Multilevel caches and giving reads priority over
the writes.
Reducing the time to hit in the cache
CACHE OPTIMIZATIONS
The classical approach to improve cache behavior is to reduce
miss rates.
Three categories of misses are:
Compulsory :
The very first access to block cannot be in the cache. So, the block
must be brought into the cache.
These are called cold-start misses or first reference misses.
Capacity:
If the cache cannot contain all the blocks needed during execution
of a program, capacity misses [ in addition to compulsory misses]
will occur because of blocks being discarded and later retrieved.
Conflict:
CACHE OPTIMIZATIONS
Compulsory Misses :
Those that occur in an infinite cache.
Capacity Misses:
Those that occur in a fully associative cache.
Conflict Misses:
Those that occur going from fully associative to eight-way
associative, fourway associative , and so on
To show the benefit of associativity, conflict misses are divided into misses
caused by each decrease in associativity.
Here are the four divisions of conflict misses and how they are calculated:
Eight-wayConflict misses due to going from fully associative (no
conflicts)
to eight-way associative
Four-wayConflict misses due to going from eight-way associative to
fourway
associative
Two-wayConflict misses due to going from four-way associative to
twoway
associative
CACHE OPTIMIZATIONS
Conceptually, conflicts are the easiest:
Fully associative placement avoids all conflict misses,
Expensive in hardware and
May slow down the processor clock rate leads to lower overall
performance.
CACHE OPTIMIZATIONS
First Optimization
Rate.
Third Optimization
Rate.
Fifth Optimization
Writes to Reduce
Sixth Optimization
Indexing of the
Q&A
On
CACHE OPTIMIZATIONS