Академический Документы
Профессиональный Документы
Культура Документы
April 9, 2013
Miss rates and miss penalties are often different for reads and writes!
Memory stall cycles=IC x Reads per instruction x Read miss rate x Read miss penalty
+ IC x Writes per instruction x Write miss rate x Write miss penalty
Example 15.2
Assume we have a computer where the cycles per instruction (CPI) is 1.0 when all memory accesses hit in the cache. The only data accesses are loads and stores, and these total 50% of the instructions. If the miss penalty is 25 clock cycles and the miss rate is 2%, how much faster would the computer be if all instructions were cache hit?
Average memory access time = Hit time + Miss rate x Miss penalty
Example 15.3
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%, and there is an average of 1.5 memory references per instructions.
What is the impact on performance when behavior of the cache is included? Compare this to the case where there is no cache.
Regs
L1 L1 d-cache i-cache L2 unified cache
Regs
L1 L1 d-cache i-cache L2 unified cache
Main memory
10
11
Improve performance by: 1. Reduce the miss rate, 2. Reduce the miss penalty, or 3. Reduce the time to hit in the cache.
12
Example 16.1
Assume the memory system takes 80 clock cycles of overhead and then delivers 16 bytes every 2 clock cycles. Based on the following table, which block size has the smallest average memory access time? Assume the hit time is 1 independent of block size.
16 3.94%
32 2.87%
64 2.64%
128 2.77%
14
2) Larger Caches
Larger caches to reduce miss rate
The obvious way to reduce capacity miss
Drawbacks?
Potentially longer hit time Higher cost Higher power
15
3) Higher Associativity
Higher associativity to reduce miss rate
Reduces conflict misses
Drawbacks?
Longer hit time
16
4) Multilevel Caches
Multilevel caches to reduce miss penalty
Reducing cache penalty can be just as beneficial as reducing miss rate Miss penalty is increasing (DRAMs become relatively slower than CPUs)
17