CS 61C: Great Ideas in Computer Architecture (Machine Structures) Traps, Excep,ons, Virtual Machines

Size: px
Start display at page:

Download "CS 61C: Great Ideas in Computer Architecture (Machine Structures) Traps, Excep,ons, Virtual Machines"

Transcription

1 // CS C: Great Ideas in Computer Architecture (Machine Structures) Traps, Excep,ons, Virtual Machines Instructors: Randy H. Katz David A. PaGerson hgp://inst.eecs.berkeley.edu/~csc/sp // Spring - - Lecture # // Spring - - Lecture # New- School Machine Structures Big Idea: Memory Hierarchy Parallel Requests Assigned to computer e.g., Search Katz Parallel Threads Assigned to core e.g., Lookup, Ads So?ware Parallel s > one Yme e.g., pipelined instrucyons Parallel Data > data one Yme e.g., Add of pairs of words Hardware descripyons All one Yme Harness Parallelism & Achieve High Performance Hardware Warehouse Scale Computer Virtual Memory Memory Input/Output Unit(s) Main Memory Computer (Cache) FuncYonal Unit(s) A +B A +B A +B A +B Today s Lecture Smart Phone Logic Gates // Spring - - Lecture # New- School Machine Structures Parallel Requests Assigned to computer e.g., Search Katz Parallel Threads Assigned to core e.g., Lookup, Ads So?ware Parallel s > one Yme e.g., pipelined instrucyons Parallel Data > data one Yme e.g., Add of pairs of words Hardware descripyons All one Yme Harness Parallelism & Achieve High Performance Hardware Warehouse Scale Computer Virtual Machines Traps Memory Input/Output Unit(s) Main Memory Computer (Cache) FuncYonal Unit(s) A +B A +B A +B A +B Today s Lecture Smart Phone Logic Gates // Spring - - Lecture # Revisted Revisted // Spring - - Lecture # // Spring - - Lecture #

2 // Virtual Address Space Virtual Address Space ~ hex ApplicaYon Physical Memory ~ hex ApplicaYon ~ hex ApplicaYon Stack Heap StaYc Code Physical Memory ~ hex ApplicaYon // Spring - - Lecture # // Spring - - Lecture # 8 Virtual Address Space Dynamic Memory AllocaYon ~ hex ApplicaYon Stack Heap StaYc Code Stack Heap StaYc Code Physical Memory ~ hex ApplicaYon ~ hex ApplicaYon malloc(9) Heap Stack Heap StaYc Code Stack Heap StaYc Code Physical Memory ~ hex ApplicaYon // Spring - - Lecture # 9 // Spring - - Lecture # Dynamic Memory AllocaYon Controlled Sharing ~ hex ApplicaYon malloc(9) Stack Heap Stack Heap StaYc Code Stack Heap StaYc Code Physical Memory ApplicaYon // Spring - - Lecture # ~ hex Recursive func,on call Stack Heap StaYc ~ hex Stack ~ hex Heap ApplicaYon StaYc ApplicaYon Code Physical Memory Shared Code X Protecon Bit // Spring - - Lecture #

3 // Controlled Sharing Stack Heap ~ hex Stack ~ hex Heap ApplicaYon Stac Code Shared Globals Physical Memory Shared Code RW Protecon Bits X Protecon Bit // Spring - - Lecture # ApplicaYon () Address No Cache, No // Spring - - Lecture # () Address () Address (PPN, Offset) Hit PTBR Base Register + VPN (@ Entry) (PPN, Offset) No Cache,, Hit Very Fast! If locality works, this is the most common case! // Spring - - Lecture # No Cache,,, Access NOTE: implemented before caches // Spring - - Lecture # () Address () Address PTBR Base Register + VPN (@ Entry) D$ (PPN, Offset) Hit PTBR Base Register + VPN (@ Entry) D$ Physical Data Cache,,, Access VA caches are possible, but it s complicated: see CS // Spring - - Lecture # (PPN, Offset) (@ Entry) Physical Data Cache,,, Access VA caches are possible, but it s complicated: see CS Spring - - Lecture # 8 //

4 // PTBR Base Register + () Address VPN (@ Entry) (@ Entry) D$ (PPN, Offset) Physical Data & Cache,,, Access VA caches are possible, but it s complicated: see CS // Spring - - Lecture # 9 I$ Hit PTBR Base Register + () Address VPN (@ Entry) (@ Entry) D$ (PPN, Offset) Day in the life of a data access is not too different Physical Data & Cache,,, Access // Spring - - Lecture # I$ Revisted Administrivia Extra Credit due / Fastest Matrix MulYply FF Grading of Project in Lab this week Final Review: Mon /, 8PM, VLSB Final Exam: Mon /9, :- :PM, Haas Pavilion Designed for 9 minutes, you will have hours Comprehensive (parycularly problem areas on midterm), but focused on course since midterm: lecture, lab, hws, and projects are fair game 8 ½ inch x inch crib sheet like midterm // Spring - - Lecture # // Spring - - Lecture # CSc in the News! President FB Yesterday! NVIDIA Tegra Processor with GHz Dual- core ARM Processor 8p MPEG- /H. Recording and Playback HDMI mirroring - inch WVGA screen 8- megapixel rear camera /.- megapixel front camera. muly- channel virtual surround sound 8GB memory microsd memory expandability (up to GB) Micro- USB connecyvity, mah bagery Supports Adobe Flash Player. LG OpYmus X Smart Phone Theater- quality entertainment on a mobile device It s Game Over for Single- core Smartphones. // Spring - - Lecture # // Spring - - Lecture # hgp:// facebook- program- dramaycally- cut- agencys- cos,9/

5 // Revisted // Spring - - Lecture # Historical RetrospecYve: 9 versus Memory used to be very expensive, and amount available to the processor was highly limited Now memory is c: approx $ per GByte in April Many apps data could not fit in main memory, e.g., payroll d memory system reduced fragmentayon but syll required whole program to be resident in the main memory For good performance, buy enough memory to hold your apps Programmers moved the data back and forth from the diskstore by overlaying it repeatedly on the primary store Programmers no longer need to worry about this level of detail anymore // Spring - - Lecture # Demand Paging in Atlas (9) Demand Paging Scheme A page from secondary storage is brought into the primary storage whenever it is (implicitly) demanded by the processor. Tom Kilburn Primary memory as a cache for secondary memory User sees x x words of storage Primary s words/page Central Memory Secondary (~disk) x pages On a page fault: Input transfer into a free page is iniyated If no free page available, a page is selected to be replaced (based on usage) Replaced page is wrigen on the disk To minimize disk latency effect, the first empty page on the disk was selected table is updated to point to the new locayon of the page on the disk // Spring - - Lecture # // Spring - - Lecture # 8 Impact on Keep track of whether page needs to be wrigen back to disk if it has been modified Set Dirty Bit in when any data in page is wrigen When entry replaced, corresponding Dirty Bit is set in Entry Address TranslaYon: Puxng it all Together Restart instrucyon Walk miss Virtual Address Lookup hit ProtecYon Check hardware hardware or soyware soyware the page is Memory memory denied permiged Fault (OS loads page) Update ProtecYon Fault Physical Address (to cache) // Spring - - Lecture # 9 // Spring - - Lecture # SEGFAULT

6 // Address TranslaYon in CPU Pipeline Inst miss? Fault? Protec,on viola,on? Inst. Cache D De E + M Data Data Cache Soyware handlers need restartable excepyon on fault Handling a miss needs a hardware or so?ware mechanism to refill Need mechanisms to cope with the addiyonal latency of a : Slow down the clock Pipeline the and cache access Virtual address caches (indexed with virtual addresses) Parallel /cache access // Spring - - Lecture # miss? Fault? Protec,on viola,on? W VA Concurrent Access to & Cache VPN L b PPN Tag Physical Tag hit? Index L is available without consulyng the cache and accesses can begin simultaneously Tag comparison is made ayer both accesses are completed Cases: L + b = k L + b < k L + b > k Offset Direct- map Cache L blocks b - byte block // Spring - - Lecture # k = Virtual Index Data Impact of Paging on AMAT Memory Parameters: L cache hit = clock cycles, hit 9% of accesses L cache hit = clock cycles, hit % of L misses DRAM = clock cycles (~ nanoseconds) Disk =,, clock cycles (~ milliseconds) Average Memory Access Time (with no paging): + %* + %*%* =. clock cycles Average Memory Access Time (with paging) = AMAT (with no paging) +?. +? // Spring - - Lecture # Student RouleGe? Impact of Paging on AMAT Memory Parameters: L cache hit = clock cycles, hit 9% of accesses L cache hit = clock cycles, hit % of L misses DRAM = clock cycles (~ nanoseconds) Disk =,, clock cycles (~ milliseconds) Average Memory Access Time (with paging) =. + %*%*(- HitMemory)*,, AMAT if HitMemory = 99.9%?. +. *. *,, =. AMAT if HitMemory = %. +. *. *,, =.9 // Spring - - Lecture # Revisted ExcepYons and Interrupts Unexpected events requiring change in flow of control Different ISAs use the terms differently ExcepYon Arises within the CPU e.g., Undefined op, overflow, syscall, Interrupt From an external I/O controller Dealing with them without sacrificing performance is difficult.9 ExcepYons // Spring - - Lecture # // Spring - - Lecture #

7 // Handling ExcepYons In MIPS, excepyons managed by a System Control Coprocessor (CP) Save of offending (or interrupted) instrucyon In MIPS: save in special register called Excep,on Program Counter (E) Save indicayon of the problem In MIPS: saved in special register called Cause register We ll assume - bit for undefined op, for overflow Jump to excepyon handler at address 8 8 hex ExcepYon ProperYes Restartable excepyons Pipeline can flush the instrucyon Handler executes, then returns to the instrucyon Refetched and executed from scratch saved in E register IdenYfies causing instrucyon Actually + is saved because of pipelined implementayon Handler must adjust to get right address // Spring - - Lecture # // Spring - - Lecture # 8 Handler AcYons Read Cause register, and transfer to relevant handler Determine acyon required If restartable excepyon Take correcyve acyon use E to return to program Otherwise Terminate program Report error using E, cause, ExcepYons in a Pipeline Another kind of control hazard Consider overflow on add in EX stage add $, $, $ Prevent $ from being clobbered Complete previous instrucyons Flush add and subsequent instrucyons Set Cause and E register values Transfer control to handler Similar to mispredicted branch Use much of the same hardware // Spring - - Lecture # 9 // Spring - - Lecture # ExcepYon Example ExcepYon on add in sub $, $, $ and $, $, $ 8 or $, $, $ C add $, $, $ slt $, $, $ lw $, ($) 8 lui $, Handler 88 sw $, ($) 88 sw $, ($) I n s t r. O r d e r and or add slt lw lui ExcepYon Example Time (clock cycles) I$ Reg D$ Reg // Spring - - Lecture # // Spring - - Lecture #

8 // I and n s or Flush t add, slt, lw r. (bubble) O r d e r (bubble) (bubble) sw ExcepYon Example Time (clock cycles) I$ st instruc,on of handler Save + into E Reg D$ Reg MulYple ExcepYons Pipelining overlaps mulyple instrucyons Could have mulyple excepyons at once E.g., fault in LW same clock cycle as Overflow of following instrucyon ADD Simple approach: deal with excepyon from earliest instrucyon, e.g., LW excepyon serviced st Flush subsequent instrucyons Called Precise excepyons In complex pipelines: MulYple instrucyons issued per cycle Out- of- order compleyon Maintaining precise excepyons is difficult! // Spring - - Lecture # // Spring - - Lecture # Imprecise ExcepYons Just stop pipeline and save state Including excepyon cause(s) Let the soyware handler work out Which instrucyon(s) had excepyons Which to complete or flush May require manual compleyon Simplifies hardware, but more complex handler soyware Not feasible for complex mulyple- issue out- of- order pipelines to always get exact instrucyon All computers today offer precise excepyons affects performance though Revisted // Spring - - Lecture # // Spring - - Lecture # Revisted // Spring - - Lecture # // Spring - - Lecture # 8 8

9 // Beyond Even greater protecyon than virtual memory E.g., Amazon Web Services allows independent tasks run on same computer Can a small operayng system simulate the hardware of some machine, so that Another operayng system can run in that simulated hardware? More than one instance of that operayng system run on the same hardware at the same Yme? More than one different operayng system can share the same hardware at the same Yme? Answer: Yes SoluYon Virtual Machine A virtual machine provides interface iden,cal to underlying bare hardware I.e., all devices, interrupts, memory, page tables, etc. VirtualizaYon has some performance impact Feasible with modern high- performance computers Examples IBM VM/ (9s technology!) VMWare Xen (used by AWS) Microsoy Virtual // Spring - - Lecture # 9 // Spring - - Lecture # Randy s Personal Experience VM/, circa 9 Summer CoNY Dept Welfare Service VM/: allows programmer to write channel programs, basically machine instrucyons (CCW channel control words) to directly control I/O devices Let s try to ring the computer s console bell Terminal log prints out the following:!!!!rrrr...ring...gggg!!!! Virtual Machines Host Opera,ng System: OS actually running on the hardware Together with virtualiza,on layer, it simulates environment for Guest Opera,ng System: OS running in the simulated environment The resources of the physical computer are shared to create the virtual machines Processor scheduling by OS can create the appearance that each user has own processor Disk paryyoned to provide virtual disks // Spring - - Lecture # // Spring - - Lecture # Virtual Machine Monitor Maps virtual resources to physical resources Memory, I/O devices, CPUs Guest runs on nayve machine in user mode Traps to VMM on privileged instrucyons and access to protected resources Guest OS may be different from host OS VMM handles real I/O devices Emulates generic virtual I/O devices for guest Example: Timer VirtualizaYon In nayve machine, on Ymer interrupt OS suspends current process, handles interrupt, selects and resumes next process With Virtual Machine Monitor VMM suspends current VM, handles interrupt, selects and resumes next VM If a VM requires Ymer interrupts VMM emulates a virtual Ymer Emulates interrupt for VM when physical Ymer interrupt occurs // Spring - - Lecture # // Spring - - Lecture # 9

10 // Virtual Machine Set Support Similar to what need for User and System modes Privileged instrucyons only available in system mode Trap to system if executed in user mode All physical resources only accessible using privileged instrucyons Including page tables, interrupt controls, I/O registers Renaissance of virtualizayon support Current ISAs (e.g., x8) adapyng, following IBM s path Revisted Spring - - Lecture # // // Spring - - Lecture # And in Conclusion,, Paging really used for ProtecYon, TranslaYon, Some OS opymizayons Not really rouynely paging to disk Can think of as another level of memory hierarchy, but not really used like caches as even greater level of protecyon to allow greater level of sharing Enables fine control, allocayon, pricing of Cloud CompuYng // Spring - - Lecture # Peer : Match the Phrase Match the memory hierarchy element on the ley with the closest phrase on the right:. L cache a. A cache for page table entries. L cache b. A cache for a main memory. Main memory c. A cache for disks. d. A cache for a cache RED) a, b, c, d ORG) a, b, d, c GRN) b, d, a, c PINK) b, d, c, a BLU) d, b, a, c PUR) d, a, b, c TEAL) d, c, b, a // Spring - - Lecture # 8 Peer : Match the Phrase Match the memory hierarchy element on the ley with the closest phrase on the right:. L cache a. A cache for page table entries. L cache b. A cache for a main memory. Main memory c. A cache for disks. d. A cache for a cache A) a, b, c, d E) b, d, c, a B) a, b, d, c F) d, b, a, c C) b, d, a, c G) d, a, b, c H) d, c, b, a // Spring - - Lecture # 9 Peer : True or False A program tries to load a word X that causes a miss but not a page fault. Which are True or False:. A miss means that the page table does not contain a valid mapping for virtual page corresponding to the address X. There is no need to look up in the page table because there is no page fault. The word that the program is trying to load is present in physical memory. RED) F, F, F ORG) F, F, T GRN) F, T, F PNK) T, F, F BLU) T, F, T PUR) T, T, F TEL) T, T, T // Spring - - Lecture #

11 // Peer : True or False A program tries to load a word X that causes a miss but not a page fault or protecyon violayons. Which are True or False:. A miss means that the page table does not contain a valid mapping for virtual page corresponding to the address X. There is no need to look up the page table because there is no page fault. The word that the program is trying to load is present in physical memory. A) F, F, F E) T, F, F B) F, F, T F) T, F, T C) F, T, F G) T, T, F H) T, T, T // Spring - - Lecture # Peer : True or False s entries have valid bits and dirty bits. Data caches have them also. A. The valid bit means the same in both: if valid =, it must miss in both s and Caches. B. The valid bit has different meanings. For caches, it means this entry is valid if the address requested matches the tag. For s, it determines whether there is a page fault (valid=) or not (valid=). C. The dirty bit means the same in both: the data in this block in the or Cache has been changed. D. The dirty bit has different meanings. For caches, it means the data block has been changed. For s, it means that the page corresponding to this entry has been changed. Red) F, T, F, T Org) F, T, T, F Grn) T, F, F, T // Spring - - Lecture # Peer : True or False s entries have valid bits and dirty bits. Data caches have them also. A. The valid bit means the same in both: if valid =, it must miss in both s and Caches. B. The valid bit has different meanings. For caches, it means this entry is valid if the address requested matches the tag. For s, it determines whether there is a page fault (valid=) or not (valid=). C. The dirty bit means the same in both: the data in this block in the or Cache has been changed. D. The dirty bit has different meanings. For caches, it means the data block has been changed. For s, it means that the page corresponding to this entry has been changed. A) F, T, F, T B) F, T, T, F C) T, F, F, T // Spring - - Lecture #

Overarching Theme for Today

Overarching Theme for Today CS 6C: Great Ideas in Computer Architecture (Machine Structures) Virtual Management Instructors: Randy H. Katz David A. PaGerson hgp://inst.eecs.berkeley.edu/~cs6c/sp 4/8/ Spring - - Lecture #4 New- School

More information

New-School Machine Structures. Overarching Theme for Today. Agenda. Review: Memory Management. The Problem 8/1/2011

New-School Machine Structures. Overarching Theme for Today. Agenda. Review: Memory Management. The Problem 8/1/2011 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Virtual Instructor: Michael Greenbaum 1 New-School Machine Structures Software Parallel Requests Assigned to computer e.g., Search Katz

More information

CS 61C: Great Ideas in Computer Architecture Direct- Mapped Caches. Increasing distance from processor, decreasing speed.

CS 61C: Great Ideas in Computer Architecture Direct- Mapped Caches. Increasing distance from processor, decreasing speed. CS 6C: Great Ideas in Computer Architecture Direct- Mapped s 9/27/2 Instructors: Krste Asanovic, Randy H Katz hdp://insteecsberkeleyedu/~cs6c/fa2 Fall 2 - - Lecture #4 New- School Machine Structures (It

More information

John Wawrzynek & Nick Weaver

John Wawrzynek & Nick Weaver CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory John Wawrzynek & Nick Weaver http://inst.eecs.berkeley.edu/~cs61c From Previous Lecture: Operating Systems Input / output (I/O) Memory

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Introduc)on to Machine Language

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Introduc)on to Machine Language CS 61C: Great Ideas in Computer Architecture (Machine Structures) Introduc)on to Machine Language TA: Sco? Beamer h?p://inst.eecs.berkeley.edu/~cs61c/sp12 1 New- School Machine Structures (It s a bit more

More information

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Virtual Memory. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Virtual Memory Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Precise Definition of Virtual Memory Virtual memory is a mechanism for translating logical

More information

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic CS 61C: Great Ideas in Computer Architecture Virtual Memory Instructors: John Wawrzynek & Vladimir Stojanovic http://inst.eecs.berkeley.edu/~cs61c/ 1 Review Programmed I/O Polling vs. Interrupts Booting

More information

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory: From Address Translation to Demand Paging Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology November 9, 2015

More information

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation CS 152 Computer Architecture and Engineering Lecture 8 - Translation Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy Chapter 5 B Large and Fast: Exploiting Memory Hierarchy Dependability 5.5 Dependable Memory Hierarchy Chapter 6 Storage and Other I/O Topics 2 Dependability Service accomplishment Service delivered as

More information

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1 Virtual Memory Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. L16-1 Reminder: Operating Systems Goals of OS: Protection and privacy: Processes cannot access each other s data Abstraction:

More information

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation CS 152 Computer Architecture and Engineering Lecture 9 - Address Translation Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste

More information

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation CS 152 Computer Architecture and Engineering Lecture 8 - Translation Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

CS 61C: Great Ideas in Computer Architecture. Virtual Memory

CS 61C: Great Ideas in Computer Architecture. Virtual Memory CS 61C: Great Ideas in Computer Architecture Virtual Memory Instructor: Justin Hsia 7/30/2012 Summer 2012 Lecture #24 1 Review of Last Lecture (1/2) Multiple instruction issue increases max speedup, but

More information

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory CS 152 Computer Architecture and Engineering Lecture 9 - Virtual Memory Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

Chapter 5 (Part II) Large and Fast: Exploiting Memory Hierarchy. Baback Izadi Division of Engineering Programs

Chapter 5 (Part II) Large and Fast: Exploiting Memory Hierarchy. Baback Izadi Division of Engineering Programs Chapter 5 (Part II) Baback Izadi Division of Engineering Programs bai@engr.newpaltz.edu Virtual Machines Host computer emulates guest operating system and machine resources Improved isolation of multiple

More information

Lecture 9 - Virtual Memory

Lecture 9 - Virtual Memory CS 152 Computer Architecture and Engineering Lecture 9 - Virtual Memory Dr. George Michelogiannakis EECS, University of California at Berkeley CRD, Lawrence Berkeley National Laboratory http://inst.eecs.berkeley.edu/~cs152

More information

CS 152 Computer Architecture and Engineering. Lecture 11 - Virtual Memory and Caches

CS 152 Computer Architecture and Engineering. Lecture 11 - Virtual Memory and Caches CS 152 Computer Architecture and Engineering Lecture 11 - Virtual Memory and Caches Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste

More information

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements CS 61C: Great Ideas in Computer Architecture Virtual II Guest Lecturer: Justin Hsia Agenda Review of Last Lecture Goals of Virtual Page Tables Translation Lookaside Buffer (TLB) Administrivia VM Performance

More information

CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. Lecture 9 Virtual Memory

CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. Lecture 9 Virtual Memory CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Lecture 9 Virtual Memory Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley

More information

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory: From Address Translation to Demand Paging Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology November 12, 2014

More information

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation CS 152 Computer Architecture and Engineering Lecture 9 - Address Translation Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

Review: Performance Latency vs. Throughput. Time (seconds/program) is performance measure Instructions Clock cycles Seconds.

Review: Performance Latency vs. Throughput. Time (seconds/program) is performance measure Instructions Clock cycles Seconds. Performance 980 98 982 983 984 985 986 987 988 989 990 99 992 993 994 995 996 997 998 999 2000 7/4/20 CS 6C: Great Ideas in Computer Architecture (Machine Structures) Caches Instructor: Michael Greenbaum

More information

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1 Virtual Memory Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. L20-1 Reminder: Operating Systems Goals of OS: Protection and privacy: Processes cannot access each other s data Abstraction:

More information

Part I: You Are Here!

Part I: You Are Here! CS 61C: Great Ideas in Computer Architecture VM 2 : Virtual Memory and Machines Instructor: Randy H. Katz hbp://inst.eecs.berkeley.edu/~cs61c/fa13 1 Parallel Requests Assigned to computer e.g., Search

More information

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: Krste Asanovic & Vladimir Stojanovic h>p://inst.eecs.berkeley.

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: Krste Asanovic & Vladimir Stojanovic h>p://inst.eecs.berkeley. CS 61C: Great Ideas in Computer Architecture Virtual Memory Instructors: Krste Asanovic & Vladimir Stojanovic h>p://inst.eecs.berkeley.edu/~cs61c/ 1 Programmed I/O Review Polling versus Interrupts Asynchronous

More information

Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Cache Performance

Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Cache Performance 6.823, L11--1 Cache Performance and Memory Management: From Absolute Addresses to Demand Paging Asanovic Laboratory for Computer Science M.I.T. http://www.csg.lcs.mit.edu/6.823 Cache Performance 6.823,

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics. Instructor: Dan Garcia h<p://inst.eecs.berkeley.

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics. Instructor: Dan Garcia h<p://inst.eecs.berkeley. CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics Instructor: Dan Garcia h

More information

Full Datapath. Chapter 4 The Processor 2

Full Datapath. Chapter 4 The Processor 2 Pipelining Full Datapath Chapter 4 The Processor 2 Datapath With Control Chapter 4 The Processor 3 Performance Issues Longest delay determines clock period Critical path: load instruction Instruction memory

More information

The Processor: Improving the performance - Control Hazards

The Processor: Improving the performance - Control Hazards The Processor: Improving the performance - Control Hazards Wednesday 14 October 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3 Instructors: Bernhard Boser & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/ 10/24/16 Fall 2016 - Lecture #16 1 Software

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 38: IO and Networking

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 38: IO and Networking CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 38: IO and Networking Instructor: Dan Garcia h

More information

10/19/17. You Are Here! Review: Direct-Mapped Cache. Typical Memory Hierarchy

10/19/17. You Are Here! Review: Direct-Mapped Cache. Typical Memory Hierarchy CS 6C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3 Instructors: Krste Asanović & Randy H Katz http://insteecsberkeleyedu/~cs6c/ Parallel Requests Assigned to computer eg, Search

More information

CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. Lecture 8 Address Transla>on

CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. Lecture 8 Address Transla>on CS 5 Computer Architecture and Engineering CS5 Graduate Computer Architecture Lecture 8 Transla>on Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 3 Instructors: Krste Asanović & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/ 10/19/17 Fall 2017 - Lecture #16 1 Parallel

More information

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY

LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY LECTURE 4: LARGE AND FAST: EXPLOITING MEMORY HIERARCHY Abridged version of Patterson & Hennessy (2013):Ch.5 Principle of Locality Programs access a small proportion of their address space at any time Temporal

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory. Bernhard Boser & Randy Katz

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory. Bernhard Boser & Randy Katz CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory Bernhard Boser & Randy Katz http://inst.eecs.berkeley.edu/~cs61c Agenda Virtual Memory Paged Physical Memory Swap Space Page Faults

More information

Improving Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Highly-Associative Caches

Improving Cache Performance and Memory Management: From Absolute Addresses to Demand Paging. Highly-Associative Caches Improving Cache Performance and Memory Management: From Absolute Addresses to Demand Paging 6.823, L8--1 Asanovic Laboratory for Computer Science M.I.T. http://www.csg.lcs.mit.edu/6.823 Highly-Associative

More information

Instructor: Randy H. Katz hap://inst.eecs.berkeley.edu/~cs61c/fa13. Fall Lecture #7. Warehouse Scale Computer

Instructor: Randy H. Katz hap://inst.eecs.berkeley.edu/~cs61c/fa13. Fall Lecture #7. Warehouse Scale Computer CS 61C: Great Ideas in Computer Architecture Everything is a Number Instructor: Randy H. Katz hap://inst.eecs.berkeley.edu/~cs61c/fa13 9/19/13 Fall 2013 - - Lecture #7 1 New- School Machine Structures

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory Krste Asanović & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/fa17 1 Agenda Virtual Memory Paged Physical Memory Swap Space

More information

HY225 Lecture 12: DRAM and Virtual Memory

HY225 Lecture 12: DRAM and Virtual Memory HY225 Lecture 12: DRAM and irtual Memory Dimitrios S. Nikolopoulos University of Crete and FORTH-ICS May 16, 2011 Dimitrios S. Nikolopoulos Lecture 12: DRAM and irtual Memory 1 / 36 DRAM Fundamentals Random-access

More information

Lecture 9 Virtual Memory

Lecture 9 Virtual Memory CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Lecture 9 Virtual Memory Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley

More information

There are different characteristics for exceptions. They are as follows:

There are different characteristics for exceptions. They are as follows: e-pg PATHSHALA- Computer Science Computer Architecture Module 15 Exception handling and floating point pipelines The objectives of this module are to discuss about exceptions and look at how the MIPS architecture

More information

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory. Last?me in Lecture 9

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory. Last?me in Lecture 9 CS 152 Computer Architecture and Engineering Lecture 9 - Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste! http://inst.eecs.berkeley.edu/~cs152!

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #22 CPU Design: Pipelining to Improve Performance II 2007-8-1 Scott Beamer, Instructor CS61C L22 CPU Design : Pipelining to Improve Performance

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1 Instructors: Bernhard Boser & Randy H. Katz hdp://inst.eecs.berkeley.edu/~cs61c/ 10/13/16 Fall 2016 - Lecture #14 1 New-School

More information

CS 61C: Great Ideas in Computer Architecture. Virtual Memory III. Instructor: Dan Garcia

CS 61C: Great Ideas in Computer Architecture. Virtual Memory III. Instructor: Dan Garcia CS 61C: Great Ideas in Computer Architecture Virtual Memory III Instructor: Dan Garcia 1 Agenda Review of Last Lecture Goals of Virtual Memory Page Tables TranslaFon Lookaside Buffer (TLB) Administrivia

More information

CS 61C: Great Ideas in Computer Architecture Excep&ons/Traps/Interrupts. Smart Phone. Core. FuncWonal Unit(s) Logic Gates

CS 61C: Great Ideas in Computer Architecture Excep&ons/Traps/Interrupts. Smart Phone. Core. FuncWonal Unit(s) Logic Gates CS 6C: Great Ideas in Computer Architecture Excep&ons/Traps/Interrupts Instructors: Krste Asanovic, Randy H. Katz hcp://inst.eecs.berkeley.edu/~cs6c/fa Review Programmed I/O versus DMA Polling versus Interrupts

More information

11/13/17. CS61C so far. Adding I/O C Programs. So How is a Laptop Any Different? It s a Real Computer! Raspberry Pi (Less than $40 on Amazon in 2017)

11/13/17. CS61C so far. Adding I/O C Programs. So How is a Laptop Any Different? It s a Real Computer! Raspberry Pi (Less than $40 on Amazon in 2017) 11/14/17 CS61C so far CS 61C: Great Ideas in Computer Architecture C Programs #include MIPS Assembly Project 2 int fib(int n) { return fib(n-1) + fib(n-2); }.foo lw $t0, 4($r0) addi $t1, $t0,

More information

Topic 18: Virtual Memory

Topic 18: Virtual Memory Topic 18: Virtual Memory COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Virtual Memory Any time you see virtual, think using a level of indirection

More information

CS 61C: Great Ideas in Computer Architecture. Lecture 22: Operating Systems. Krste Asanović & Randy H. Katz

CS 61C: Great Ideas in Computer Architecture. Lecture 22: Operating Systems. Krste Asanović & Randy H. Katz CS 61C: Great Ideas in Computer Architecture Lecture 22: Operating Systems Krste Asanović & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/fa17 1 CPU Project 2 CS61C so far MIPS Assembly.foo lw $t0,

More information

CS 61C: Great Ideas in Computer Architecture. Input/Output

CS 61C: Great Ideas in Computer Architecture. Input/Output CS 61C: Great Ideas in Computer Architecture Input/Output Instructor: Justin Hsia 1 Review of Last Lecture (1/2) Great Idea: Dependability via Redundancy Reliability: MTTF & Annualized Failure Rate Availability:

More information

lecture 18 cache 2 TLB miss TLB - TLB (hit and miss) - instruction or data cache - cache (hit and miss)

lecture 18 cache 2 TLB miss TLB - TLB (hit and miss) - instruction or data cache - cache (hit and miss) lecture 18 2 virtual physical virtual physical - TLB ( and ) - instruction or data - ( and ) Wed. March 16, 2016 Last lecture I discussed the TLB and how virtual es are translated to physical es. I only

More information

Virtual Memory. CS61, Lecture 15. Prof. Stephen Chong October 20, 2011

Virtual Memory. CS61, Lecture 15. Prof. Stephen Chong October 20, 2011 Virtual Memory CS6, Lecture 5 Prof. Stephen Chong October 2, 2 Announcements Midterm review session: Monday Oct 24 5:3pm to 7pm, 6 Oxford St. room 33 Large and small group interaction 2 Wall of Flame Rob

More information

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic disk 5ms 20ms, $0.20 $2 per

More information

CS252 Spring 2017 Graduate Computer Architecture. Lecture 17: Virtual Memory and Caches

CS252 Spring 2017 Graduate Computer Architecture. Lecture 17: Virtual Memory and Caches CS252 Spring 2017 Graduate Computer Architecture Lecture 17: Virtual Memory and Caches Lisa Wu, Krste Asanovic http://inst.eecs.berkeley.edu/~cs252/sp17 WU UCB CS252 SP17 Last Time in Lecture 16 Memory

More information

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM

Computer Architecture Computer Science & Engineering. Chapter 5. Memory Hierachy BK TP.HCM Computer Architecture Computer Science & Engineering Chapter 5 Memory Hierachy Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM) 50ns 70ns, $20 $75 per GB Magnetic

More information

Agenda. Cache-Memory Consistency? (1/2) 7/14/2011. New-School Machine Structures (It s a bit more complicated!)

Agenda. Cache-Memory Consistency? (1/2) 7/14/2011. New-School Machine Structures (It s a bit more complicated!) 7/4/ CS 6C: Great Ideas in Computer Architecture (Machine Structures) Caches II Instructor: Michael Greenbaum New-School Machine Structures (It s a bit more complicated!) Parallel Requests Assigned to

More information

LECTURE 3: THE PROCESSOR

LECTURE 3: THE PROCESSOR LECTURE 3: THE PROCESSOR Abridged version of Patterson & Hennessy (2013):Ch.4 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU

More information

10/11/17. New-School Machine Structures. Review: Single Cycle Instruction Timing. Review: Single-Cycle RISC-V RV32I Datapath. Components of a Computer

10/11/17. New-School Machine Structures. Review: Single Cycle Instruction Timing. Review: Single-Cycle RISC-V RV32I Datapath. Components of a Computer // CS C: Great Ideas in Computer Architecture (Machine Structures) s Part Instructors: Krste Asanović & Randy H Katz http://insteecsberkeleyedu/~csc/ // Fall - Lecture # Parallel Requests Assigned to computer

More information

Last =me in Lecture 7 3 C s of cache misses Compulsory, Capacity, Conflict

Last =me in Lecture 7 3 C s of cache misses Compulsory, Capacity, Conflict CS 152 Computer Architecture and Engineering Lecture 8 - Transla=on Krste Asanovic Electrical Engineering and Computer Sciences University of California at Berkeley http://www.eecs.berkeley.edu/~krste!

More information

CSE 560 Computer Systems Architecture

CSE 560 Computer Systems Architecture This Unit: CSE 560 Computer Systems Architecture App App App System software Mem I/O The operating system () A super-application Hardware support for an Page tables and address translation s and hierarchy

More information

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names Fast access ===> use map to find object HW == SW ===> map is in HW or SW or combo Extend range ===> longer, hierarchical names How is map embodied: --- L1? --- Memory? The Environment ---- Long Latency

More information

ecture 33 Virtual Memory Friedland and Weaver Computer Science 61C Spring 2017 April 12th, 2017

ecture 33 Virtual Memory Friedland and Weaver Computer Science 61C Spring 2017 April 12th, 2017 ecture 33 Computer Science 61C Spring 2017 April 12th, 2017 Virtual Memory 1 Multiprogramming The OS runs multiple applications at the same time. But not really: have many more processes/threads than available

More information

CSE 451: Operating Systems Winter Page Table Management, TLBs and Other Pragmatics. Gary Kimura

CSE 451: Operating Systems Winter Page Table Management, TLBs and Other Pragmatics. Gary Kimura CSE 451: Operating Systems Winter 2013 Page Table Management, TLBs and Other Pragmatics Gary Kimura Moving now from Hardware to how the OS manages memory Two main areas to discuss Page table management,

More information

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception Outline A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception 1 4 Which stage is the branch decision made? Case 1: 0 M u x 1 Add

More information

CS 61C: Great Ideas in Computer Architecture Strings and Func.ons. Anything can be represented as a number, i.e., data or instruc\ons

CS 61C: Great Ideas in Computer Architecture Strings and Func.ons. Anything can be represented as a number, i.e., data or instruc\ons CS 61C: Great Ideas in Computer Architecture Strings and Func.ons Instructor: Krste Asanovic, Randy H. Katz hdp://inst.eecs.berkeley.edu/~cs61c/sp12 Fall 2012 - - Lecture #7 1 New- School Machine Structures

More information

This lecture. Virtual Memory. Virtual memory (VM) CS Instructor: Sanjeev Se(a

This lecture. Virtual Memory. Virtual memory (VM) CS Instructor: Sanjeev Se(a Virtual Memory Instructor: Sanjeev Se(a This lecture (VM) Overview and mo(va(on VM as tool for caching VM as tool for memory management VM as tool for memory protec(on Address transla(on 2 Virtual Memory

More information

Transla'on, Protec'on, and Virtual Memory. 2/25/16 CS 152 Sec'on 6 Colin Schmidt

Transla'on, Protec'on, and Virtual Memory. 2/25/16 CS 152 Sec'on 6 Colin Schmidt Transla'on, Protec'on, and Virtual Memory 2/25/16 CS 152 Sec'on 6 Colin Schmidt Agenda Protec'on Transla'on Virtual Memory Lab 1 Feedback Ques'ons/Open-ended discussion Hand back Lab 1 Protec'on Why? Supervisor

More information

CS162 Operating Systems and Systems Programming Lecture 14. Caching and Demand Paging

CS162 Operating Systems and Systems Programming Lecture 14. Caching and Demand Paging CS162 Operating Systems and Systems Programming Lecture 14 Caching and Demand Paging October 17, 2007 Prof. John Kubiatowicz http://inst.eecs.berkeley.edu/~cs162 Review: Hierarchy of a Modern Computer

More information

Page 1. CS162 Operating Systems and Systems Programming Lecture 14. Caching and Demand Paging

Page 1. CS162 Operating Systems and Systems Programming Lecture 14. Caching and Demand Paging CS162 Operating Systems and Systems Programming Lecture 14 Caching and Demand Paging March 4, 2010 Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Review: Hierarchy of a Modern Computer System Take advantage

More information

Modern Virtual Memory Systems. Modern Virtual Memory Systems

Modern Virtual Memory Systems. Modern Virtual Memory Systems 6.823, L12--1 Modern Virtual Systems Asanovic Laboratory for Computer Science M.I.T. http://www.csg.lcs.mit.edu/6.823 6.823, L12--2 Modern Virtual Systems illusion of a large, private, uniform store Protection

More information

Another View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements

Another View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements CS61C L25 Virtual I (1) inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #25 Virtual I 27-8-7 Scott Beamer, Instructor Another View of the Hierarchy Thus far{ Next: Virtual { Regs Instr.

More information

Carnegie Mellon. Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition

Carnegie Mellon. Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition Carnegie Mellon Virtual Memory: Concepts 5-23: Introduction to Computer Systems 7 th Lecture, October 24, 27 Instructor: Randy Bryant 2 Hmmm, How Does This Work?! Process Process 2 Process n Solution:

More information

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner CPS104 Computer Organization and Programming Lecture 16: Virtual Memory Robert Wagner cps 104 VM.1 RW Fall 2000 Outline of Today s Lecture Virtual Memory. Paged virtual memory. Virtual to Physical translation:

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1 CS 61C: Great Ideas in Computer Architecture (Machine Structures) Caches Part 1 Instructors: Krste Asanović & Randy H. Katz http://inst.eecs.berkeley.edu/~cs61c/ 10/11/17 Fall 2017 - Lecture #14 1 Parallel

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Intro to Virtual Memory

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Intro to Virtual Memory CS 61C: Great Ideas in Computer Architecture (Machine Structures) Intro to Virtual Memory Instructors: Vladimir Stojanovic and Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/ 1 Agenda Multiprogramming/time-sharing

More information

18-447: Computer Architecture Lecture 16: Virtual Memory

18-447: Computer Architecture Lecture 16: Virtual Memory 18-447: Computer Architecture Lecture 16: Virtual Memory Justin Meza Carnegie Mellon University (with material from Onur Mutlu, Michael Papamichael, and Vivek Seshadri) 1 Notes HW 2 and Lab 2 grades will

More information

Virtual Memory: Concepts

Virtual Memory: Concepts Virtual Memory: Concepts Instructor: Dr. Hyunyoung Lee Based on slides provided by Randy Bryant and Dave O Hallaron Today Address spaces VM as a tool for caching VM as a tool for memory management VM as

More information

Processes and Virtual Memory Concepts

Processes and Virtual Memory Concepts Processes and Virtual Memory Concepts Brad Karp UCL Computer Science CS 37 8 th February 28 (lecture notes derived from material from Phil Gibbons, Dave O Hallaron, and Randy Bryant) Today Processes Virtual

More information

Virtual Memory I. CSE 351 Spring Instructor: Ruth Anderson

Virtual Memory I. CSE 351 Spring Instructor: Ruth Anderson Virtual Memory I CSE 35 Spring 27 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Midterms Graded If you did

More information

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory CPS 104 Computer Organization and Programming Lecture 20: Virtual Nov. 10, 1999 Dietolf (Dee) Ramm http://www.cs.duke.edu/~dr/cps104.html CPS 104 Lecture 20.1 Outline of Today s Lecture O Virtual. 6 Paged

More information

14 May 2012 Virtual Memory. Definition: A process is an instance of a running program

14 May 2012 Virtual Memory. Definition: A process is an instance of a running program Virtual Memory (VM) Overview and motivation VM as tool for caching VM as tool for memory management VM as tool for memory protection Address translation 4 May 22 Virtual Memory Processes Definition: A

More information

CS 61C: Great Ideas in Computer Architecture. Multiple Instruction Issue, Virtual Memory Introduction

CS 61C: Great Ideas in Computer Architecture. Multiple Instruction Issue, Virtual Memory Introduction CS 61C: Great Ideas in Computer Architecture Multiple Instruction Issue, Virtual Memory Introduction Instructor: Justin Hsia 7/26/2012 Summer 2012 Lecture #23 1 Parallel Requests Assigned to computer e.g.

More information

COEN-4730 Computer Architecture Lecture 3 Review of Caches and Virtual Memory

COEN-4730 Computer Architecture Lecture 3 Review of Caches and Virtual Memory 1 COEN-4730 Computer Architecture Lecture 3 Review of Caches and Virtual Memory Cristinel Ababei Dept. of Electrical and Computer Engineering Marquette University Credits: Slides adapted from presentations

More information

CS61C : Machine Structures

CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #23: VM I 2006-08-08 CS 61C L23 VM I (1) Andy Carle Outline Cache Review Virtual Memory CS 61C L23 VM I (2) Improving Miss Penalty

More information

LECTURE 10. Pipelining: Advanced ILP

LECTURE 10. Pipelining: Advanced ILP LECTURE 10 Pipelining: Advanced ILP EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls, returns) that changes the normal flow of instruction

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN 5 Edition th The Hardware/Software Interface Chapter 4 The Processor 4.1 Introduction Introduction CPU performance factors Instruction count CPI and Cycle time Determined

More information

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Patterson & Hennessey Chapter 5 ELEC 5200/6200 1 Virtual Memory Use main memory as a cache for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs

More information

18-447: Computer Architecture Lecture 18: Virtual Memory III. Yoongu Kim Carnegie Mellon University Spring 2013, 3/1

18-447: Computer Architecture Lecture 18: Virtual Memory III. Yoongu Kim Carnegie Mellon University Spring 2013, 3/1 18-447: Computer Architecture Lecture 18: Virtual Memory III Yoongu Kim Carnegie Mellon University Spring 2013, 3/1 Upcoming Schedule Today: Lab 3 Due Today: Lecture/Recitation Monday (3/4): Lecture Q&A

More information

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili Virtual Memory Lecture notes from MKP and S. Yalamanchili Sections 5.4, 5.5, 5.6, 5.8, 5.10 Reading (2) 1 The Memory Hierarchy ALU registers Cache Memory Memory Memory Managed by the compiler Memory Managed

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics Instructor: Dan Garcia h

More information

Virtual Memory - Objectives

Virtual Memory - Objectives ECE232: Hardware Organization and Design Part 16: Virtual Memory Chapter 7 http://www.ecs.umass.edu/ece/ece232/ Adapted from Computer Organization and Design, Patterson & Hennessy Virtual Memory - Objectives

More information

Homework 5. Start date: March 24 Due date: 11:59PM on April 10, Monday night. CSCI 402: Computer Architectures

Homework 5. Start date: March 24 Due date: 11:59PM on April 10, Monday night. CSCI 402: Computer Architectures Homework 5 Start date: March 24 Due date: 11:59PM on April 10, Monday night 4.1.1, 4.1.2 4.3 4.8.1, 4.8.2 4.9.1-4.9.4 4.13.1 4.16.1, 4.16.2 1 CSCI 402: Computer Architectures The Processor (4) Fengguang

More information

CS162 Operating Systems and Systems Programming Lecture 14. Caching (Finished), Demand Paging

CS162 Operating Systems and Systems Programming Lecture 14. Caching (Finished), Demand Paging CS162 Operating Systems and Systems Programming Lecture 14 Caching (Finished), Demand Paging October 11 th, 2017 Neeraja J. Yadwadkar http://cs162.eecs.berkeley.edu Recall: Caching Concept Cache: a repository

More information

Topic 18 (updated): Virtual Memory

Topic 18 (updated): Virtual Memory Topic 18 (updated): Virtual Memory COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Virtual Memory Any time you see virtual, think using a level

More information

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy

Chapter 5B. Large and Fast: Exploiting Memory Hierarchy Chapter 5B Large and Fast: Exploiting Memory Hierarchy One Transistor Dynamic RAM 1-T DRAM Cell word access transistor V REF TiN top electrode (V REF ) Ta 2 O 5 dielectric bit Storage capacitor (FET gate,

More information

Main Memory (Fig. 7.13) Main Memory

Main Memory (Fig. 7.13) Main Memory Main Memory (Fig. 7.13) CPU CPU CPU Cache Multiplexor Cache Cache Bus Bus Bus Memory Memory bank 0 Memory bank 1 Memory bank 2 Memory bank 3 Memory b. Wide memory organization c. Interleaved memory organization

More information

Virtual Memory Review. Page faults. Paging system summary (so far)

Virtual Memory Review. Page faults. Paging system summary (so far) Lecture 22 (Wed 11/19/2008) Virtual Memory Review Lab #4 Software Simulation Due Fri Nov 21 at 5pm HW #3 Cache Simulator & code optimization Due Mon Nov 24 at 5pm More Virtual Memory 1 2 Paging system

More information

Memory Hierarchy Requirements. Three Advantages of Virtual Memory

Memory Hierarchy Requirements. Three Advantages of Virtual Memory CS61C L12 Virtual (1) CS61CL : Machine Structures Lecture #12 Virtual 2009-08-03 Jeremy Huddleston Review!! Cache design choices: "! Size of cache: speed v. capacity "! size (i.e., cache aspect ratio)

More information