Unformatted text preview:

CS61C Review of Cache VM TLB Lecture 26 April 30 1999 Dave Patterson http cs berkeley edu patterson www inst eecs berkeley edu cs61c schedule html cs 61C L26 cachereview 1 Patterson Spring 99 UCB Outlin e Review Pipelining Review Cache VM TLB Review slides Administrivia What s this Stuff Good for 4 Questions on Memory Hierarchy Detailed Example Alpha 21064 3Cs of Caches if time permits Cache Impact on Algorithms if time permits Conclusion cs 61C L26 cachereview 2 Patterson Spring 99 UCB Review 1 3 Pipelining Introduction Pipelining is a fundamental concept Multiple steps using distinct resources Exploiting parallelism in instructions What makes it easy MIPS vs 80x86 All instructions are the same length simple instruction fetch Just a few instruction formats read registers before decode instruction Memory operands only in loads and stores fewer pipeline stages Data aligned 1 memory access load store cs 61C L26 cachereview 3 Patterson Spring 99 UCB Review 2 3 Pipelining Introduction What makes it hard Structural hazards suppose we had only one cache Need more HW resources Control hazards need to worry about branch instructions Branch prediction delayed branch Data hazards an instruction depends on a previous instruction need forwarding compiler scheduling cs 61C L26 cachereview 4 Patterson Spring 99 UCB Review 3 3 Advanced Concepts Superscalar Issue Execution Retire Start several instructions each clock cycle 1999 3 4 instructions Execute on multiple units in parallel Retire in parallel HW guarantees appearance of simple single instruction execution Out of order Execution Instructions issue in order but execute out oforder when hazards occur load use cache miss multiplier busy Instructions retire in order HW guarantees appearance of simple in order execution cs 61C L26 cachereview 5 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 Principle of Locality in time in space Hierarchy of Memories of different speed cost exploit to improve cost performance cs 61C L26 cachereview 6 Patterson Spring 99 UCB Why Caches Performance 1000 100 1 Moore s Law Processor Memory Performance Gap grows 50 year DRAM DRAM 7 yr 198 198 0 1 198 198 2 198 3 198 4 5 198 198 6 198 7 198 8 1 999 199 0 199 199 2 199 3 199 4 199 5 199 6 199 7 8 199 200 9 0 10 Proc 60 yr CPU 1989 first Intel CPU with cache on chip 1999 gap Tax 37 area of Alpha 21164 61 StrongArm SA110 64 Pentium Pro cs 61C L26 cachereview 7 Patterson Spring 99 UCB Why virtual memory 1 2 Protection regions of the address space can be read only execute only Flexibility portions of a program can be placed anywhere without relocation Expandability can leave room in virtual address space for objects to grow Storage management allocation deallocation of variable sized blocks is costly and leads to external fragmentation paging solves this cs 61C L26 cachereview 8 Patterson Spring 99 UCB Why virtual memory 2 2 Generality ability to run programs larger than size of physical memory Storage efficiency retain only most important portions of the program in memory Concurrent I O execute other processes while loading dumping page cs 61C L26 cachereview 9 Patterson Spring 99 UCB Why Translation Lookaside Buffer TLB Paging is most popular implementation of virtual memory vs base bounds Every paged virtual memory access must be checked against Entry of Page Table in memory Cache of Page Table Entries makes address translation possible without memory access in common case cs 61C L26 cachereview 10 Patterson Spring 99 UCB Paging Virtual Memory Review User A Virtual Memory 0 Stack Physical Memory 64 MB User B TLB Virtual Memory Stack Heap Heap Static Static Code cs 61C L26 cachereview 11 A Page 0 Table B Page Code Table 0 Patterson Spring 99 UCB Three Advantages of Virtual Memory 1 Translation Program can be given consistent view of memory even though physical memory is scrambled Makes multiple processes reasonable Only the most important part of program Working Set must be in physical memory Contiguous structures like stacks use only as much physical memory as necessary yet still grow later cs 61C L26 cachereview 12 Patterson Spring 99 UCB Three Advantages of Virtual Memory 2 Protection Different processes protected from each other Different pages can be given special behavior Read Only Invisible to user programs etc Kernel data protected from User programs Very important for protection from malicious programs Far more viruses under Microsoft Windows 3 Sharing Can map same physical page to multiple users Shared memory cs 61C L26 cachereview 13 Patterson Spring 99 UCB Virtual Memory Summary Virtual Memory allows protected sharing of memory between processes with less swapping to disk less fragmentation than always swap or base bound 3 Problems 1 Not enough memory Spatial Locality means small Working Set of pages OK 2 TLB to reduce performance cost of VM 3 Need more compact representation to reduce memory size cost of simple 1 level page table especially for 64 bit address See CS 162 cs 61C L26 cachereview 14 Patterson Spring 99 UCB Administrivia 11th homework last Due Today Next Readings A 7 M 5 3 Deadline to correct your grade record up to 11th lab 10th homework 5th project W 5 5 Review Interrupts Polling A 7 F 5 7 61C Summary Your Cal heritage HKN Course Evaluation Due Final 61C Survey in lab Sun 5 9 Final Review starting 2PM 1 Pimintel W5 12 Final 5 8PM 1 Pimintel Bring 2 sheets both sides 2 pencils No calculators No blue books cs 61C L26 cachereview 15 Patterson Spring 99 UCB What s This Stuff Potentially Good For Allow civilians to find mines mass graves plan disaster relief cs 61C L26 cachereview 16 Private Spy in Space to Rival Military s Ikonos 1 spacecraft is just 0 8 tons 15 feet long with its solar panels extended it runs on just 1 200 watts of power a bit more than a toaster It sees objects as small as one meter and covers Earth every 3 days The company plans to sell the imagery for 25 to 300 per square mile via www spaceimaging com We believe it will fundamentally change the approach to many forms of information that we use in business and our private lives N Y Times 4 27 99 Patterson Spring 99 UCB 4 Questions for Memory Hierarchy Q1 Where can a block be placed in the upper level Block placement Q2 How is a block found if it is in the upper level Block identification Q3 Which


View Full Document

Berkeley COMPSCI 61C - Lecture 26

Documents in this Course
SIMD II

SIMD II

8 pages

Midterm

Midterm

7 pages

Lecture 7

Lecture 7

31 pages

Caches

Caches

7 pages

Lecture 9

Lecture 9

24 pages

Lecture 1

Lecture 1

28 pages

Lecture 2

Lecture 2

25 pages

VM II

VM II

4 pages

Midterm

Midterm

10 pages

Load more
Loading Unlocking...
Login

Join to view Lecture 26 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 26 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?