DOC PREVIEW
Berkeley COMPSCI 61C - Lecture 26 Review of Cache

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

cs 61C L26 cachereview.1Patterson Spring 99 ©UCBCS61C Review of Cache/VM/TLBLecture 26April 30, 1999Dave Patterson(http.cs.berkeley.edu/~patterson)www-inst.eecs.berkeley.edu/~cs61c/schedule.htmlcs 61C L26 cachereview.2Patterson Spring 99 ©UCBOutline°Review Pipelining°Review Cache/VM/TLB Review slides°Administrivia, “What’s this Stuff Good for?”°4 Questions on Memory Hierarchy°Detailed Example°3Cs of Caches (if time permits)°Cache Impact on Algorithms (if time permits)°Conclusioncs 61C L26 cachereview.3Patterson Spring 99 ©UCBReview 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, storecs 61C L26 cachereview.4Patterson Spring 99 ©UCBReview 2/3: Pipelining Introduction°What makes it hard?°Structural hazards: suppose we had onlyone cache?⇒ Need more HW resources°Control hazards: need to worry aboutbranch instructions? ⇒ Branch prediction, delayed branch°Data hazards: an instruction depends ona previous instruction? ⇒ need forwarding, compiler schedulingcs 61C L26 cachereview.5Patterson Spring 99 ©UCBReview 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 appearanceof simple single instruction execution°Out-of-order Execution:• Instructions issue in-order, but execute out-of-order when hazards occur (load-use, cachemiss, multiplier busy, ...)• Instructions retire in-order; HW guaranteesappearance of simple in-order executioncs 61C L26 cachereview.6Patterson Spring 99 ©UCBMemory Hierarchy PyramidLevels inmemoryhierarchyCentral Processor Unit (CPU)Size of memory at each levelPrinciple of Locality (in time, in space) +Hierarchy of Memories of different speed,cost; exploit to improve cost-performanceLevel 1Level 2Level nIncreasingDistancefrom CPU,Decreasingcost / MB“Upper”“Lower”Level 3. . .cs 61C L26 cachereview.7Patterson Spring 99 ©UCBWhy Caches?µProc60%/yr.DRAM7%/yr.110100100019801981198319841985198619871988198919901991199219931994199519961997199819992000DRAMCPU1982Processor-MemoryPerformance Gap:(grows 50% / year)Performance“Moore’s Law” 1989 first Intel CPU with cache on chip;Today 37% area of Alpha 21164,61% StrongArm SA110, 64% Pentium Procs 61C L26 cachereview.8Patterson Spring 99 ©UCBWhy virtual memory? (1/2)° Protection• regions of the address space can be readonly, execute only, . . .° Flexibility• portions of a program can be placedanywhere, without relocation° Expandability• can leave room in virtual address space forobjects to grow° Storage management• allocation/deallocation of variable sizedblocks is costly and leads to (external)fragmentationcs 61C L26 cachereview.9Patterson Spring 99 ©UCBWhy virtual memory? (2/2)° Generality• ability to run programs larger than size ofphysical memory° Storage efficiency• retain only most important portions of theprogram in memory° Concurrent I/O• execute other processes whileloading/dumping pagecs 61C L26 cachereview.10Patterson Spring 99 ©UCBWhy Translation Lookaside Buffer (TLB)?°Paging is most popularimplementation of virtual memory(vs. base/bounds)°Every paged virtual memory accessmust be checked againstEntry of Page Table in memory°Cache of Page Table Entries makesaddress translation possible withoutmemory access in common casecs 61C L26 cachereview.11Patterson Spring 99 ©UCBPaging/Virtual Memory ReviewUser B: Virtual Memory∞CodeStaticHeapStack0CodeStaticHeapStackA PageTableB PageTableUser A: Virtual Memory∞00Physical Memory64 MBTLBcs 61C L26 cachereview.12Patterson Spring 99 ©UCBThree Advantages of Virtual Memory1) Translation:• Program can be given consistent view ofmemory, even though physical memory isscrambled• Makes multiple processes reasonable• Only the most important part of program(“Working Set”) must be in physical memory.• Contiguous structures (like stacks) use onlyas much physical memory as necessary yetstill grow later.cs 61C L26 cachereview.13Patterson Spring 99 ©UCBThree Advantages of Virtual Memory2) 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 maliciousprograms ⇒ Far more “viruses” underMicrosoft Windows3) Sharing:• Can map same physical page to multiple users(“Shared memory”)cs 61C L26 cachereview.14Patterson Spring 99 ©UCBVirtual Memory Summary°Virtual Memory allows protected sharing ofmemory between processes with lessswapping to disk, less fragmentation thanalways swap or base/bound°3 Problems:1) Not enough memory: Spatial Localitymeans small Working Set of pages OK2) TLB to reduce performance cost of VM3) Need more compact representation toreduce memory size cost of simple 1-levelpage table, especially for 64-bit address(See CS 162)cs 61C L26 cachereview.15Patterson Spring 99 ©UCBAdministrivia°11th homework (last): Due Today°Next Readings: A.7M 5/3 Deadline to correct your grade record(up to 11th lab, 10th homework, 5th project)W 5/5 Review: Interrupts / Polling; A.7F 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)• Need Early Final? Contact mds@corycs 61C L26 cachereview.16Patterson Spring 99 ©UCB“What’s This Stuff (Potentially) Good For?”Allow civilians to findmines, mass graves,plan disaster relief?Private Spy in Space to RivalMilitary's Ikonos 1 spacecraft isjust 0.8 tons, 15 feet long with itssolar panels extended, it runs on just1,200 watts of power -- a bit morethan a toaster. It sees objects assmall as one meter, and coversEarth every 3 days. The companyplans to sell the imagery for $25 to$300 per square mile viawww.spaceimaging.com."We believe it will fundamentallychange the approach to many formsof information that we use inbusiness and our private


View Full Document

Berkeley COMPSCI 61C - Lecture 26 Review of Cache

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
Download Lecture 26 Review of Cache
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 26 Review of Cache 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 Review of Cache 2 2 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?