CS61C Memory Hierarchy Introduction and Eight Week Review Lecture 16 March 12 1999 Dave Patterson http cs berkeley edu patterson www inst eecs berkeley edu cs61c schedule html cs 61C L16 Review 1 Patterson Spring 99 UCB Review 1 1 Magnetic Disks continue rapid advance 60 yr capacity 40 yr bandwidth slow on seek rotation improvements MB improving 100 yr Designs to fit high volume form factor Quoted seek times too conservative data rates too optimistic for use in system RAID Higher performance with more disk arms per Adds availability option at modest cost cs 61C L16 Review 2 Patterson Spring 99 UCB Outlin e Memory Hierarchy Analogy Illusion of Large Fast Cheap Memory Principle of Locality Terms Who manages each level of Hierarchy Administrivia Computer in the News Big Ideas on 61C What we ve seen so far Conclusion cs 61C L16 Review 3 Patterson Spring 99 UCB Hierarchy Analogy Term Paper in Library Working on paper in library at a desk Option 1 Every time need a book Leave desk to go to shelves or stacks Find the book Bring one book back to desk Read section interested in When done with section leave desk and go to shelves carrying book Put the book back on shelf Return to desk to work Next time need a book go to first step cs 61C L16 Review 4 Patterson Spring 99 UCB Hierarcgy Analogy Library Option 2 Every time need a book Leave some books on desk after fetching them Only go to shelves when need a new book When go to shelves bring back related books in case you need them sometimes you ll need to return books not used recently to make space for new books on desk Return to desk to work When done replace books on shelves carrying as many as you can per trip Illusion whole library on your desktop cs 61C L16 Review 5 Patterson Spring 99 UCB Technology Trends CapacitySpeed latency Processor 4x in 3 yrs DRAM 4x in 3 yrs 2x in 10 yrs Disk 2x in 10 yrs 4x in 3 yrs Year 1980 1983 1986 1989 1993 1997 cs 61C L16 Review 6 DRAM Size 64 Kb 256 Kb 1 Mb 4 Mb 16 Mb 64 Mb 1000 1 Cycle Time 250 ns 220 ns 190 ns 165 ns 145 ns 120 ns 2 1 Patterson Spring 99 UCB Who Cares About the Memory Hierarchy Processor DRAM Memory Gap latency Proc 60 yr 2X 1 5yr Processor Memory Performance Gap grows 50 year DRAM DRAM 9 yr 2X 10 yrs Performance 1000 CPU 100 10 198 198 0 1 198 198 2 198 3 198 4 5 198 198 6 198 7 198 8 199 9 199 0 199 199 2 199 3 199 4 199 5 199 6 199 7 8 199 200 9 0 1 cs 61C L16 Review 7 Time Patterson Spring 99 UCB The Goal Illusion of large fast cheap memory Fact Large memories are slow fast memories are small How do we create a memory that is large cheap and fast most of the time Hierarchy of Levels Similar to Principle of Abstraction hide details of multiple levels cs 61C L16 Review 8 Patterson Spring 99 UCB Why Hierarchy works Natural Locality The Principle of Locality Program access a relatively small portion of the address space at any instant of time Probability of reference 0 2 n 1 Address Space What programming constructs lead to Principle of Locality cs 61C L16 Review 9 Patterson Spring 99 UCB Memory Hierarchy How Does it Work Temporal Locality Locality in Time Keep most recently accessed data items closer to the processor Library Analogy Recently read books are kept on desk Block is unit of transfer like book Spatial Locality Locality in Space Move blocks consists of contiguous words to the upper levels Library Analogy Bring back nearby books on shelves when fetch a book hope that you might need it later for your paper cs 61C L16 Review 10 Patterson Spring 99 UCB Memory Hierarchy Pyramid Central Processor Unit CPU Increasing Upper Distance from CPU Level 1 Levels in Decreasing memory Level 2 cost MB hierarchy Lower Level 3 Level n Size of memory at each level data cannot be in level i unless also in i 1 cs 61C L16 Review 11 Patterson Spring 99 UCB Big Idea of Memory Hierarchy Temporal locality keep recently accessed data items closer to processor Spatial locality moving contiguous words in memory to upper levels of hierarchy Uses smaller and faster memory technologies close to the processor Fast hit time in highest level of hierarchy Cheap slow memory furthest from processor If hit rate is high enough hierarchy has access time close to the highest and fastest level and size equal to the lowest and largest level cs 61C L16 Review 12 Patterson Spring 99 UCB Memory Hierarchy Terminology Hit data appears in some block in the upper level example Block X Hit Rate the fraction of memory access found in the upper level Analogy fraction of time find book on desk Miss data needs to be retrieve from a block in the lower level Block Y Miss Rate 1 Hit Rate Analogy fraction of time must go to shelves for book cs 61C L16 Review 13 Patterson Spring 99 UCB Memory Hierarchy Terminology Hit Time Time to access the upper level which consists of Time to determine hit miss Memory access time Analogy time to find pick up book from desk Miss Penalty Time to replace a block in the upper level Time to deliver the block the processor Analogy time to go to shelves find needed book and return it to your desk pick up Note Hit Time Miss Penalty cs 61C L16 Review 14 Patterson Spring 99 UCB Current Memory Hierarchy Processor Control L1 Regs Data path Speed ns 0 5ns 2ns Size MB 0 0005 0 05 Cost MB 100 Technology Regs SRAM cs 61C L16 Review 15 L2 Cache Main Memory Secondary Memory 6ns 1 4 30 100ns 10 000 000ns 100 1000 100 000 1 0 05 SRAM DRAM Disk Patterson Spring 99 UCB Memory Hierarchy Technology Random Access Random is good access time is the same for all locations binary hardware tree to select table entry billionths of a second DRAM Dynamic Random Access Memory High density low power cheap slow Dynamic needs to be refreshed regularly SRAM Static Random Access Memory Low density high power expensive fast Static content last forever until lose power Sequential Access Technology access cs 61C L16 Review 16 Patterson Spring 99 UCB How is the hierarchy managed Registers Memory By compiler or Asm Programmer Cache Main Memory By the hardware Main Memory Disks By the hardware and operating system virtual memory after the break By the programmer Files cs 61C L16 Review 17 Patterson Spring 99 UCB Administrivia Upcoming events Midterm Review Sunday 3 14 2PM 1 Pimentel Fill out questionnaire answer questions Conflict Midterm Mon 3 15 6PM 405 Soda Midterm on Wed 3 17 5pm 8PM 1 Pimentel No discussion section 3 18 3 19 Friday before Break 3 19 video tape by Gordon Moore Nanometers …
View Full Document
Unlocking...