Lecture 12

22
DAP Spr.‘98 ©UCB 1 Lecture 12: Memory Hierarchy—Ways to Reduce Misses

description

practice problems

Transcript of Lecture 12

DAP Spr.98 UCB 1Lecture 12: Memory HierarchyWays to Reduce MissesDAP Spr.98 UCB 2Review: Four Questions for Memory Hierarchy Desiners Q1: Where can a !"oc# !e $"aced in the u$$er "eve"% (Block placement) Fu""y &ssociative' (et &ssociative' Direct Ma$$ed Q2: How is a !"oc# found if it is in the u$$er "eve"% (Block identification) )a*+"oc# Q,: Which !"oc# shou"d !e re$"aced on a miss% (Block replacement) Random' LR-Q.: What ha$$ens on a write% (Write strategy) Write +ac# or Write )hrouh /with Write +uffer0DAP Spr.98 UCB 3Review: 1ache 2erformance12-time 3 4nstruction 1ount 5 /124e5ecution 6 Mem accesses $er instruction 5 Miss rate 5 Miss $ena"ty0 5 1"oc# cyc"e timeMisses $er instruction 3 Memory accesses $er instruction 5 Miss rate12-time 3 41 5 /124e5ecution 6 Misses $er instruction 5 Miss $ena"ty0 5 1"oc# cyc"e time)o 4m$rove 1ache 2erformance:17 Reduce the miss rate 27 Reduce the miss $ena"ty,7 Reduce the time to hit in the cache7DAP Spr.98 UCB 4Reducin Misses 1"assifyin Misses: , 1s Compulsory)he first access to a !"oc# is not in the cache' so the !"oc# must !e !rouht into the cache7 &"so ca""ed cold start misses or first reference misses7(Misses in even an Infinite Cache) Capacity4f the cache cannot contain a"" the !"oc#s needed durin e5ecution of a $roram' ca$acity misses wi"" occur due to !"oc#s !ein discarded and "ater retrieved7(Misses in Fully Associative Sie ! Cache) Conflict4f !"oc#8$"acement stratey is set associative or direct ma$$ed' conf"ict misses /in addition to com$u"sory 9 ca$acity misses0 wi"" occur !ecause a !"oc# can !e discarded and "ater retrieved if too many !"oc#s ma$ to its set7 &"so ca""ed collision misses or interference misses7(Misses in "#$ay Associative% Sie ! Cache)DAP Spr.98 UCB 5Cache Size (KB) Miss Rate per Type00.020.040.060.080.10.120.1412481632641281-way2-way4-way8-wayCapacityC!p"#sry,1s &!so"ute Miss Rate /(2:1;201onf"ict 3 miss rate 28way associative cache si=e >*2DAP Spr.98 UCB 7How 1an Reduce Misses%, 1s: 1om$u"sory' 1a$acity' 1onf"ict4n a"" cases' assume tota" cache si=e not chaned:What ha$$ens if:10 1hane +"oc# (i=e: Which of ,1s is o!vious"y affected%20 1hane &ssociativity: Which of ,1s is o!vious"y affected%,0 1hane 1om$i"er: Which of ,1s is o!vious"y affected%DAP Spr.98 UCB 8B#c$ Size (%ytes) Miss Rate 0&'&10&1'&20&2'&1632641282'61K4K16K64K2'6K17 Reduce Misses via Larer +"oc# (i=eDAP Spr.98 UCB 927 Reduce Misses via Hiher &ssociativity2:1 1ache Ru"e: Miss Rate DM cache si=e