Overarching Theme for Today

Size: px
Start display at page:

Download "Overarching Theme for Today"

Transcription

1 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 Machine Structures Big Idea: Hierarchy Parallel Requests Assigned to computer e.g., Search Katz Parallel Threads Assigned to core e.g., Lookup, Ads So8ware Parallel InstrucYons > one Yme e.g., 5 pipelined instrucyons Parallel Data > data one Yme e.g., Add of 4 pairs of words Hardware descripyons All one Yme Harness Parallelism & Achieve High Performance Hardware Warehouse Scale Computer Virtual Core Input/Output InstrucYon Unit(s) Main Computer (Cache) Core Core FuncYonal Unit(s) A +B A +B A +B A +B Today s Lecture Smart Phone Logic Gates Overarching Theme for Today Any problem in computer science can be solved by an extra level of indireccon. Ofen agributed to Butler Lampson (Berkeley PhD and Professor, Turing Award Winner), who in turn, agributed it to David Wheeler, a BriYsh computer scienyst, who also Butler Lampson said except for the problem of too many layers of indireccon! 4 HW ProtecYon Virtual Another View of Virtual HW ProtecYon Virtual Another View of Virtual 5 6

2 Review: C Management ~ FFFF FFFF C has three pools of data hex (+ ) StaYc storage: global variable storage, basically permanent, enyre program run The Stack: local variable storage, parameters, return address The Heap (dynamic storage): malloc() grabs space from here, free() returns it Common (Dynamic) Problems Using uniniyalized values Accessing beyond your allocated region Improper use of free/realloc by messing with the pointer handle returned by malloc leaks: mismatched malloc/free pairs prevents accesses between and 7 (via virtual ) Simplest Model Only one program running on the computer es in the program are exactly the physical addresses Extensions to the simple model: What if less physical than full address space? What if we want to run mulyple programs at the same Yme? 8 Problem #: Physical Less Than the Full One architecture, many implementayons, with possibly different amounts of used to very expensive and physically bulky Where does the grow from then? Logical Virtual 9 Real Idea: Level of IndirecYon to Create Illusion of Large Physical Hi Order Bits of Virtual Map or Table Hi Order Bits of Physical Logical Virtual Physical Real Virtual Page Page Problem #: MulYple Programs Sharing the Machine s How can we run mulyple programs without accidentally stepping on same addresses? How can we protect programs from clobbering each other? ApplicaYon ApplicaYon Idea: Level of IndirecYon to Create Illusion of Separate s One table per running applicayon OR Real swap table contents when switching

3 Extension to the Simple Model MulYple programs sharing the same address space E.g., OperaYng system uses low end of address range shared with applicayon MulYple programs in shared (virtual) address space StaYc management: fixed paryyoning/allocayon of space Dynamic management: programs come and go, take different amount of Yme to execute, use different amounts of How can we protect programs from clobbering each other? How can we allocate to applicayons on demand? (4 GB - 64 MB) ~ hex ~ FFF FFFF hex 8 bytes (64 MB) StaYc Division of Shared ApplicaYon OperaYng System E.g., how to manage the carving up of the address space among and applicayons? Where does the end and the applicayon begin? Dynamic management, with protecyon, would be beger! 4 First Idea: Base + Bounds Registers for LocaYon Independence LocaYon- independent programs Programming and storage management ease: need for a base register ProtecYon Independent programs should not affect each other inadvertently: need for a bound register Historically, base + bounds registers were a very early idea in computer architecture Max addr addr prog prog 5 Physical Simple Base and Bound TranslaYon lw X Bound Register EffecYve Segment Length Base Register Base Physical Program Base and bounds registers are visible/accessible to programmer Trap to if bounds violayon detected ( seg fault / core dumped ) 6 + Bounds ViolaYon? Physical current segment Physical pgm pgm pgm K Programs Sharing pgms 4 & 5 arrive pgm pgm pgm 4 pgm pgm 5 8K K pgms & 5 leave Why do we want to run mulyple programs? Run others while waicng for I/O What prevents programs from accessing each other s data? pgm pgm 4 pgm 8K K free 7 RestricYon on Base + Bounds Regs Want only the OperaYng System to be able to change Base and Bound Registers Processors need different execuyon modes. User mode: can use Base and Bound Registers, but cannot change them. Supervisor mode: can use and change Base and Bound Registers Also need Mode Bit (=User, =Supervisor) to determine processor mode Also need way for program in User Mode to invoke operayng system in Supervisor Mode, and vice versa 8

4 pgm pgm pgm Programs Sharing K pgms 4 & 5 arrive pgm pgm pgm 4 pgm pgm 5 8K K pgms & 5 leave pgm pgm 4 pgm As programs come and go, the storage is fragmented. Therefore, at some stage programs have to be moved around to compact the storage. Easy way to do this? 8K K free HW ProtecYon Virtual Another View of Virtual 9 Administrivia Administrivia Extra Credit due 4/4 Fastest Matrix MulYply EC not limited to three fastest projects! You get EC for % improvement over your Project # Submit working if your Project # did not work FF Grading of Project #4 in Lab this week Final Review: Mon 5/, 5 8PM, 5 VLSB Final Exam: Mon 5/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 hgp:// professor- meme// HW ProtecYon Virtual Another View of Virtual Idea #: s to Avoid FragmentaYon Divide address space into equal sized blocks, called pages TradiYonally 4 KB or 8 KB Use a level of indireccon to map program addresses into addresses One indirecyon mapping per address space page This table of mappings is called a page table 4 4

5 Paged Systems Processor- generated address is split into: Virtual page number bits bits Page table contains the physical address of the base of each page: Program consists of 4x 4K Byte pages or 684 Bytes (think of an array of base registers or pointers) Page tables make it possible to store the pages of a program non- concguously. - bit byte address 496 byte pages Physical 5 Pgm Pgm Pgm Separate per Program VA VA VA Each program has own page table Page table contains an entry for each program page pages free Physical 6 Paging Terminology Program addresses called virtual addresses of all virtual addresses called virtual addresses called physical addresses of all physical addresses called physical 7 Processes and Virtual Allow mulyple processes to simultaneously occupy and provide protecyon don t let one program read/write from another Each has own PC,, Like threads, except processes have separate address spaces space give each program the illusion that it has its own private Suppose starts at address x4. But different processes have different, both residing at the same (virtual) address. So each program has a different view of. 8 Combine Idea # and Idea #: ProtecYon via Access Rights checked on every access to see if allowed Read: can read, but not write page Read/Write: read or write data on page Execute: Can fetch instrucyons from page Valid = Valid page table entry 9 More Depth on s Virtual : Base Reg page no. bits index into page table... V A.R. P. P. A. Val - id Access Rights.... bits Physical Page located in physical + Physical 5

6 TranslaYon & ProtecYon Kernel/User Mode Read/Write ExcepYon? Virtual ProtecYon Check Physical Virtual Page No. (VPN) TranslaYon Physical Page No. (PPN) Every instrucyon and data access needs address translayon and protecyon checks PaGerson s Analogy Book Ytle like virtual address Library of Congress call number like physical address Card catalogue like page table, mapping from book Ytle to call # On card, available for - hour in library use (vs. - week checkout) like access rights Where Should s Reside? required by the page tables is proporyonal to the address space, number of users, requirement is large: e.g., byte address space, byte pages = table entries = 4 x 4 entries (per program!) How many bits per page table entry? Too expensive to keep in processor registers! Where Should s Reside? Idea: Keep page tables in the main One reference to retrieve the page base address from table in Second access to retrieve the data word Doubles the number of references! Why is this bad news? 4 VA s Can Be HUGE: Put Them In Physical User Virtual VA User Virtual PT User PT User Physical 5 Virtual Without Doubling Accesses Caches suggest that there is temporal and spayal locality of data Locality of data really means locality of addresses of that data What about locality of translayons of virtual page addresses into physical page addresses? For historical reasons, called TranslaCon Lookaside Buffer (TLB) More accurate name is Cache 6 6

7 HW ProtecYon Virtual Another View of Virtual TranslaYon Lookaside Buffers (TLB): Another Layer of IndirecYon! translayon is very expensive! Each reference becomes accesses SoluYon: Cache address translacons in TLB! TLB hit Single Cycle TranslaCon TLB miss Access Page- Table to refill V R W X tag hit? PPN virtual address VPN (VPN = virtual page number) (PPN = physical page number) physical address PPN 7 8 TLB Design Typically - 8 entries Usually fully associayve: why wouldn t direct mapped work? 9 Historical RetrospecYve: 96 versus used to be very expensive, and amount available to the processor was highly limited Now is c: approx $ per GByte in April Many apps data could not fit in main, e.g., payroll Paged system reduced fragmentayon but syll required whole program to be resident in the main For good performance, buy enough 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 4 Demand Paging in Atlas (96) A page from secondary storage is brought into the primary storage whenever it is (implicitly) demanded by the processor. Tom Kilburn Primary as a cache for secondary User sees x 6 x 5 words of storage Primary Pages 5 words/page Central Secondary (~disk) x6 pages Demand Paging Scheme 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 Page table is updated to point to the new locayon of the page on the disk 4 4 7

8 Notes on Solves the fragmentayon problem: all chunks same size, so any holes can be used must reserve Swap on disk for each process To grow a process, ask OperaYng System If unused pages available, uses them first If not, swaps some old pages to disk (Least Recently Used to pick pages to swap) How/Why grow a process? 44 Impact on TLB Keep track of whether page needs to be wrigen back to disk if its been modified Set Page Dirty Bit in TLB when any data in page is wrigen When TLB entry replaced, corresponding Page Dirty Bit is set in Entry 45 Hardware/Sofware Support for ProtecYon Different tasks can share parts of their virtual address spaces But need to protect against errant access Requires assistance Hardware support for protecyon Privileged supervisor mode (aka kernel mode) Privileged instrucyons Page tables and other state informayon only accessible in supervisor mode System call excepyon (e.g., syscall in MIPS) Modern Virtual Systems Illusion of a large, private, uniform store ProtecYon & Privacy Several users, each with their private address and one or more shared address spaces page table name space Demand Paging Provides ability to run programs larger than the primary Hides differences in machine configurayons Price is address translacon on each reference; But disk so slow that performance suffers if going to disk all the Cme ( thrashing ) Spring 4/8/ - - Lecture # user i Primary VA Mapping Swapping Store PA HW ProtecYon Virtual Another View of Virtual 4/8/ 48 Spring - - Lecture #4 49 8

9 HW ProtecYon Virtual Another View of Virtual Another View of Virtual : Just Another Part of Hierarchy Use main as a cache for secondary (disk) storage Managed jointly by CPU hardware and the operayng system () Programs share main Each gets a private virtual address space holding its frequently used and data Protected from other programs CPU and translate virtual addresses to physical addresses VM block is called a page VM translayon miss is called a page fault 5.4 Virtual 5 5 Just Another View of Hierarchy Virtual { Regs Instr. Operands Cache Blocks L Cache Blocks Pages Disk Files Tape Upper Level Faster Larger Lower Level Caching vs. Demand Paging 5 5 CPU cache primary CPU primary secondary Caching Demand paging cache entry page frame cache block (~ bytes) page (~4K bytes) cache miss rate (% to %) page miss rate (<.%) cache hit (~ cycle) page hit (~ cycles) cache miss (~ cycles) page miss (~5M cycles) a miss is handled a miss is handled in hardware mostly in so8ware TranslaYon: Pu~ng it all Together Restart instrucyon Page Fault ( loads page) Walk miss Virtual TLB Lookup Update TLB ProtecYon Check the page is denied permiged Physical (to cache) SEGFAULT 54 hit ProtecYon Fault hardware hardware or sofware sofware TranslaYon in CPU Pipeline PC Inst TLB TLB miss? Page Fault? ProtecCon violacon? Inst. Cache D De E + M Data TLB Data Cache Sofware handlers need restartable excepyon on TLB fault Handling a TLB miss needs a hardware or so8ware mechanism to refill TLB Need mechanisms to cope with the addiyonal latency of a TLB: Slow down the clock Pipeline the TLB and cache access Virtual address caches (indexed with virtual addresses) Parallel TLB/cache access TLB miss? Page Fault? ProtecCon violacon? W 55 9

10 VA PA Concurrent Access to TLB & Cache VPN L b PPN Tag TLB Physical Tag hit? Index L is available without consulyng the TLB cache and TLB accesses can begin simultaneously Tag comparison is made afer both accesses are completed Cases: L + b = k L + b < k L + b > k Page Offset Direct- map Cache L blocks b - byte block 56 k = Virtual Index Data Impact of Paging on AMAT Parameters: L cache hit = clock cycles, hit 95% of accesses L cache hit = clock cycles, hit 6% of L misses DRAM = clock cycles (~ nanoseconds) Disk =,, clock cycles (~ milliseconds) Average Access Time (with no paging): + 5%* + 5%*4%* = 5.5 clock cycles Average Access Time (with paging) = AMAT (with no paging) +? 5.5 +? 57 Modern Management Slowdown too great to run much bigger programs than Called Thrashing Buy more or run program on bigger computer or reduce size of problem Paging system today syll used for TranslaCon (mapping of virtual address to physical address) ProtecCon (permission to access word in ) Sharing of between independent tasks Impact of TLBs on Performance Each TLB miss to ~ L Cache miss Page sizes are 4 KB to 8 KB (4 KB on x86) TLB has typically 8 entries Set AssociaYve or Fully AssociaYve TLB Reach: Size of largest virtual address space that can be simultaneously mapped by TLB: 8 * 4 KB = 5 KB =.5 MB! What can you do to have becer performance? 59 6 Nehalem Virtual Details 48- bit virtual address space, 4- bit physical address space Two- level TLB: L + L I- TLB (L) has shared 8 entries 4- way associayve for 4KB pages, plus 7 dedicated fully- associayve entries per SMT thread for large page (/4MB) entries D- TLB (L) has 64 entries for 4KB pages and entries for /4MB pages, both 4- way associayve, dynamically shared between SMT threads Unified L TLB has 5 entries for 4KB pages only, also 4- way associayve Data TLB Reach (4 KB only) L: 64*4 KB =.5 MB, L:5*4 KB= MB (superpages) L: *- 4 MB = 64-8 MB Using Large Pages from ApplicaYon? Difficulty is communicayng from applicayon to operayng system that want to use large pages Linux: Huge pages via a library file system and mapping; beyond 6C See hgp://lwn.net/arycles/7596/ hgp:// display/linuxp/libhuge+short+and+simple Max X: no support for applicayons to do this ( decides if should use or not) 4/8/ Spring Lecture #4 6

11 TranslaYon & ProtecYon Kernel/User Mode Read/Write Excep<on? Virtual ProtecYon Check Physical Virtual Page No. (VPN) TranslaYon Physical Page No. (PPN) Every instruccon and data access needs address translayon and protecyon checks Good VM design needs to be fast (~ one cycle) and space efficient And in Conclusion, Separate Management into orthogonal funcyons: TranslaCon (mapping of virtual address to physical address) ProtecCon (permission to access word in ) But most modern systems provide support for all funcyons with single page- based system All desktops/servers have full demand- paged virtual Portability between machines with different sizes ProtecYon between mulyple users or mulyple tasks Share small physical among acyve tasks Simplifies implementayon of some features Hardware support: User/Supervisor Mode, invoke Supervisor Mode, TLB, Register 64 65

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 (Machine Structures) Traps, Excep,ons, Virtual Machines

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Traps, Excep,ons, Virtual Machines // 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

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 - 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

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

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

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 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

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

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

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

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

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

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

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

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 35 Virtual Memory II 2007-04-16 Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia Hardware repair?! This technology allows

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

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

COSC3330 Computer Architecture Lecture 20. Virtual Memory

COSC3330 Computer Architecture Lecture 20. Virtual Memory COSC3330 Computer Architecture Lecture 20. Virtual Memory Instructor: Weidong Shi (Larry), PhD Computer Science Department University of Houston Virtual Memory Topics Reducing Cache Miss Penalty (#2) Use

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

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

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

Computer Architecture Lecture 13: Virtual Memory II

Computer Architecture Lecture 13: Virtual Memory II 18-447 Computer Architecture Lecture 13: Virtual Memory II Lecturer: Rachata Ausavarungnirun Carnegie Mellon University Spring 2014, 2/17/2014 (with material from Onur Mutlu, Justin Meza and Yoongu Kim)

More information

Address spaces and memory management

Address spaces and memory management Address spaces and memory management Review of processes Process = one or more threads in an address space Thread = stream of executing instructions Address space = memory space used by threads Address

More information

Lecture 19: Virtual Memory: Concepts

Lecture 19: Virtual Memory: Concepts CSCI-UA.2-3 Computer Systems Organization Lecture 9: Virtual Memory: Concepts Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified) from: Clark Barrett

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

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

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

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. March 23, Levels in Memory Hierarchy. DRAM vs. SRAM as a Cache. Page 1. Motivation #1: DRAM a Cache for Disk

virtual memory. March 23, Levels in Memory Hierarchy. DRAM vs. SRAM as a Cache. Page 1. Motivation #1: DRAM a Cache for Disk 5-23 March 23, 2 Topics Motivations for VM Address translation Accelerating address translation with TLBs Pentium II/III system Motivation #: DRAM a Cache for The full address space is quite large: 32-bit

More information

Computer Systems. Virtual Memory. Han, Hwansoo

Computer Systems. Virtual Memory. Han, Hwansoo Computer Systems Virtual Memory Han, Hwansoo A System Using Physical Addressing CPU Physical address (PA) 4 Main memory : : 2: 3: 4: 5: 6: 7: 8:... M-: Data word Used in simple systems like embedded microcontrollers

More information

V. Primary & Secondary Memory!

V. Primary & Secondary Memory! V. Primary & Secondary Memory! Computer Architecture and Operating Systems & Operating Systems: 725G84 Ahmed Rezine 1 Memory Technology Static RAM (SRAM) 0.5ns 2.5ns, $2000 $5000 per GB Dynamic RAM (DRAM)

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

CS162 - Operating Systems and Systems Programming. Address Translation => Paging"

CS162 - Operating Systems and Systems Programming. Address Translation => Paging CS162 - Operating Systems and Systems Programming Address Translation => Paging" David E. Culler! http://cs162.eecs.berkeley.edu/! Lecture #15! Oct 3, 2014!! Reading: A&D 8.1-2, 8.3.1. 9.7 HW 3 out (due

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

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

Chapter 8. Virtual Memory

Chapter 8. Virtual Memory Operating System Chapter 8. Virtual Memory Lynn Choi School of Electrical Engineering Motivated by Memory Hierarchy Principles of Locality Speed vs. size vs. cost tradeoff Locality principle Spatial Locality:

More information

Virtual Memory. Virtual Memory

Virtual Memory. Virtual Memory Virtual Memory Virtual Memory Main memory is cache for secondary storage Secondary storage (disk) holds the complete virtual address space Only a portion of the virtual address space lives in the physical

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

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1 Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Recap: Virtual Addresses A virtual address is a memory address that a process uses to access its own memory Virtual address actual physical

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

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches CS 61C: Great Ideas in Computer Architecture Direct Mapped Caches Instructor: Justin Hsia 7/05/2012 Summer 2012 Lecture #11 1 Review of Last Lecture Floating point (single and double precision) approximates

More information

198:231 Intro to Computer Organization. 198:231 Introduction to Computer Organization Lecture 14

198:231 Intro to Computer Organization. 198:231 Introduction to Computer Organization Lecture 14 98:23 Intro to Computer Organization Lecture 4 Virtual Memory 98:23 Introduction to Computer Organization Lecture 4 Instructor: Nicole Hynes nicole.hynes@rutgers.edu Credits: Several slides courtesy of

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 Processor-Memory Performance Gap 10000 µproc 55%/year (2X/1.5yr) Performance 1000 100 10 1 1980 1983 1986 1989 Moore s Law Processor-Memory Performance

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

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

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

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

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

Virtual Memory. CS 3410 Computer System Organization & Programming

Virtual Memory. CS 3410 Computer System Organization & Programming Virtual Memory CS 3410 Computer System Organization & Programming These slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. Where are we now and

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

Virtual Memory Virtual memory first used to relive programmers from the burden of managing overlays.

Virtual Memory Virtual memory first used to relive programmers from the burden of managing overlays. CSE420 Virtual Memory Prof. Mokhtar Aboelaze York University Based on Slides by Prof. L. Bhuyan (UCR) Prof. M. Shaaban (RIT) Virtual Memory Virtual memory first used to relive programmers from the burden

More information

Virtual Memory. CS 3410 Computer System Organization & Programming. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

Virtual Memory. CS 3410 Computer System Organization & Programming. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon] Virtual Memory CS 3410 Computer System Organization & Programming [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon] Click any letter let me know you re here today. Instead of a DJ Clicker Question today,

More information

Virtual Memory Oct. 29, 2002

Virtual Memory Oct. 29, 2002 5-23 The course that gives CMU its Zip! Virtual Memory Oct. 29, 22 Topics Motivations for VM Address translation Accelerating translation with TLBs class9.ppt Motivations for Virtual Memory Use Physical

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

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

EECS 482 Introduction to Operating Systems

EECS 482 Introduction to Operating Systems EECS 482 Introduction to Operating Systems Fall 2018 Baris Kasikci Slides by: Harsha V. Madhyastha Base and bounds Load each process into contiguous region of physical memory Prevent process from accessing

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

ECE468 Computer Organization and Architecture. Virtual Memory

ECE468 Computer Organization and Architecture. Virtual Memory ECE468 Computer Organization and Architecture Virtual Memory ECE468 vm.1 Review: The Principle of Locality Probability of reference 0 Address Space 2 The Principle of Locality: Program access a relatively

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

15 Sharing Main Memory Segmentation and Paging

15 Sharing Main Memory Segmentation and Paging Operating Systems 58 15 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Virtual Memory. Physical Addressing. Problem 2: Capacity. Problem 1: Memory Management 11/20/15

Virtual Memory. Physical Addressing. Problem 2: Capacity. Problem 1: Memory Management 11/20/15 Memory Addressing Motivation: why not direct physical memory access? Address translation with pages Optimizing translation: translation lookaside buffer Extra benefits: sharing and protection Memory as

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

Virtual Memory II CSE 351 Spring

Virtual Memory II CSE 351 Spring Virtual Memory II CSE 351 Spring 2018 https://xkcd.com/1495/ Virtual Memory (VM) Overview and motivation VM as a tool for caching Address translation VM as a tool for memory management VM as a tool for

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

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

Chapter 5. Large and Fast: Exploiting Memory Hierarchy

Chapter 5. Large and Fast: Exploiting Memory Hierarchy Chapter 5 Large and Fast: Exploiting Memory Hierarchy Processor-Memory Performance Gap 10000 µproc 55%/year (2X/1.5yr) Performance 1000 100 10 1 1980 1983 1986 1989 Moore s Law Processor-Memory Performance

More information

ECE4680 Computer Organization and Architecture. Virtual Memory

ECE4680 Computer Organization and Architecture. Virtual Memory ECE468 Computer Organization and Architecture Virtual Memory If I can see it and I can touch it, it s real. If I can t see it but I can touch it, it s invisible. If I can see it but I can t touch it, it

More information

CS162 Operating Systems and Systems Programming Lecture 12. Address Translation. Page 1

CS162 Operating Systems and Systems Programming Lecture 12. Address Translation. Page 1 CS162 Operating Systems and Systems Programming Lecture 12 Translation March 10, 2008 Prof. Anthony D. Joseph http://inst.eecs.berkeley.edu/~cs162 Review: Important Aspects of Memory Multiplexing Controlled

More information

61C In the News. Review. Memory Management Today. Impact of Paging on AMAT

61C In the News. Review. Memory Management Today. Impact of Paging on AMAT 61C In the News A Touchscreen Anywhere You Want It Published October 28, 2011 By Brian Albright OmniTouch combines a laser- based pico projector and depth- sensing camera (a prototype from PrimeSense),

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

Page 1. Review: Address Segmentation " Review: Address Segmentation " Review: Address Segmentation "

Page 1. Review: Address Segmentation  Review: Address Segmentation  Review: Address Segmentation Review Address Segmentation " CS162 Operating Systems and Systems Programming Lecture 10 Caches and TLBs" February 23, 2011! Ion Stoica! http//inst.eecs.berkeley.edu/~cs162! 1111 0000" 1110 000" Seg #"

More information

1. Creates the illusion of an address space much larger than the physical memory

1. Creates the illusion of an address space much larger than the physical memory Virtual memory Main Memory Disk I P D L1 L2 M Goals Physical address space Virtual address space 1. Creates the illusion of an address space much larger than the physical memory 2. Make provisions for

More information

Memory. Principle of Locality. It is impossible to have memory that is both. We create an illusion for the programmer. Employ memory hierarchy

Memory. Principle of Locality. It is impossible to have memory that is both. We create an illusion for the programmer. Employ memory hierarchy Datorarkitektur och operativsystem Lecture 7 Memory It is impossible to have memory that is both Unlimited (large in capacity) And fast 5.1 Intr roduction We create an illusion for the programmer Before

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

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

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

Virtual Memory: Concepts

Virtual Memory: Concepts Virtual Memory: Concepts 5-23: Introduction to Computer Systems 7 th Lecture, March 2, 27 Instructors: Franz Franchetti & Seth Copen Goldstein Hmmm, How Does This Work?! Process Process 2 Process n Solution:

More information

Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement. Léon Mugwaneza

Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement. Léon Mugwaneza Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement May 05, 2008 Léon Mugwaneza http://www.it.uu.se/edu/course/homepage/os/vt08 Review: Multiprogramming (with

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

Carnegie Mellon. 16 th Lecture, Mar. 20, Instructors: Todd C. Mowry & Anthony Rowe

Carnegie Mellon. 16 th Lecture, Mar. 20, Instructors: Todd C. Mowry & Anthony Rowe Virtual Memory: Concepts 5 23 / 8 23: Introduction to Computer Systems 6 th Lecture, Mar. 2, 22 Instructors: Todd C. Mowry & Anthony Rowe Today Address spaces VM as a tool lfor caching VM as a tool for

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

16 Sharing Main Memory Segmentation and Paging

16 Sharing Main Memory Segmentation and Paging Operating Systems 64 16 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

Memory Hierarchy. Mehran Rezaei

Memory Hierarchy. Mehran Rezaei Memory Hierarchy Mehran Rezaei What types of memory do we have? Registers Cache (Static RAM) Main Memory (Dynamic RAM) Disk (Magnetic Disk) Option : Build It Out of Fast SRAM About 5- ns access Decoders

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Paged MMU: Two main Issues Translation speed can be slow TLB Table size is big Multi-level page table

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 27, FALL 2012

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 27, FALL 2012 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 27, FALL 2012 ANNOUNCEMENTS Need student input on Lecturer Search Max Morawski Lecture 2:30pm 3:15pm, Fri 12/7, ITE 217 Meet with

More information