Virtual Memory. Stefanos Kaxiras. Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources.
|
|
- Christal Dickerson
- 5 years ago
- Views:
Transcription
1 Virtual Memory Stefanos Kaxiras Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources.
2 Caches Review & Intro Intended to make the slow main memory look fast by automatically copying useful data in fast memory Fundamental Principle: Locality of reference (temporal & spatial) Programs tend to spend their time on small subsets of the memory What is Virtual Memory? BUT: VM is much more than this! Intended to expand main memory, using the disk as Offers a much each process larger its albeit slower storage medium own ADDRESS SPACE Speed differential cache-to-mem & Protection! mem-to-disk changes many of the tradeoffs! FAST VAST CPU Cache (fast) Memory (DRAM-slow) DISK Virtual memory x-x 5 x
3 History & Motivation Historical need Main memory & addresses started small... Need to run programs bigger than main memory Overlays: programmer orchestrates the movement of code and data in and out of main memory (from secondary storage) in the same address space Ouch! Need to expand memory automatically BUT: Physical Memory The solution!= Address (ATLAS, Space 96): Virtual Physical Memory Memory is what Illusion you have that (buy) each program has Address space There the is whole what is only address your one mistake program space that available is can allowed be made to it in to on computer have by design the ISA that its own is difficult to recover from not having enough address Corollary: bits start for memory with a huge addressing address and memory space management. or else you ll need a new Gordon ISA Bell fast and Bill Strecker PDP 8, speaking,, about Intel the 886, PDP- 886, in 886, etc Map multiple address spaces on: (a much 976 Programs live in the smaller) address physical space, memory can + be (a big, much expand, contract (stack, heap), larger) but disk, typically automatically use only a small part at any time (locality) highly dynamic behavior How to map address spaces on to memory & manage it?
4 Virtual memory: map DRAM (Virtual) Pages Virtual ADDRESS SPACE Page Frames or Physical Pages How to do it: Divide Virtual address space & mem into fixedsized blocks (e.g., KB, MB): Pages & Page frames (e.g., KB) Alternatively: variable-sized blocks called Segments DISK Swap file
5 Virtual memory: map DRAM Virtual ADDRESS SPACE (H&P Q) Where Can a Page (Block) Be Placed in Main Memory? How to do it: In VM: anywhere FULLY Divide Virtual address space ASSOCIATIVE & mem into fixedsized blocks (e.g., KB, MB): Pages & Page frames Contrast (e.g., KB) w/ Caches: Fixed place for Keep the hot pages of a block the program (Direct-Mapped) in memory within a The rest on disk set (Set-Assoc.) Transparency: program does not differentiate RAM or DISK Hot (active) pages go to memory (H&P Q) How is a Page (Block) Found IF It Is in Main Memory? Cold (rarely used) pages go In Caches: Matched TAGS to DISK BUT VM is FA! (would need to search ALL tags) DISK Instead: Use an INDIRECTION TABLE!
6 Virtual memory: map One-to-One DRAM Virtual ADDRESS SPACE Page Table DISK Loc: DISK Loc: 5 DISK Loc: 6 7 R D Page Frame or Disk loc. How to do it: All we need to make it work is an Indirection Table called a Page Table Foreach virtual page shows its location: In RAM page frame (physical page number) On disk location on disk Additional bits in page table entries: Resident, Dirty, Valid (not shown), protection bits (not shown) DISK Hot (active) pages go to memory Cold (rarely used) pages go to DISK
7 Virtual memory: map multiple Another Virtual ADDRESS SPACE Another Page Table Page Table DISK Loc: DISK Loc: DISK Loc: DISK Loc: Protection: different programs occupy different address spaces VM keeps the page mappings separate! DRAM DISK Hot (active) pages go to memory Cold (rarely used) pages go to DISK More on protection later
8 Virtual memory: automatically CPU issues Virtual Addresses (VA): V Page Offset Virtual ADDRESS SPACE Page Table DISK Loc: DISK Loc: DRAM Hot (active) pages go to memory Page Frame or Disk loc. Programs live in the Virtual address space CPU issues virtual addresses Composed of a virtual page number (highorder address bits) Offset within the page (low order bits) But really want to go to main memory R D DISK Loc: DISK Cold (rarely used) pages go to Disk
9 Virtual memory: automatically CPU issues Virtual Addresses (VA): V Page Offset P Page Offset Page Table DISK Loc: DISK Loc: Physical Address (PA) DRAM Hot (active) pages go to memory Page Frame or Disk loc. ADDRESS TRANSLATION: VA PA Index the Page Table with the virtual page # If resident PT gives page frame # Access the physical page at that frame and use the same offset to get what you want Common case that needs to happen FAST! R D DISK Loc: DISK Cold (rarely used) pages go to DISK
10 Virtual memory: automatically CPU issues Virtual Addresses (VA): V Page Offset Page Table DISK Loc: PAGE FAULT Index the Page Table with the (H&P virtual Q) Which page Block # Should R DBe If not resident PT gives DISK Replaced loc. on a Virtual Memory Miss? Need to bring in the page from the disk! Page Frame or UNCOMMON case that is delegated to SW OS Disk loc. Important to get it right! manages this:. Make an empty frame Latency (LRU, is Clock, not an WS, issue, done by SW see your OS course!) (OS). Replace old page with requested page. Patch the PT with the Contrast new location w/ Caches: of the do it fast use page. Restart the access pseudo-lru or simpler in SA DISK Loc: DISK Loc: DRAM Bring in the new page Patch the PT (H&P Q) What Happens on a Write? VM is strictly write-back Writing through to disk on every store to memory is simply too much! Dirty pages (D-bit set) selected for DISK replacement need to be written back to disk.
11 Sanity check # Address translation via the page table needs to happen fast How big is this page table? Example IA: bit Addr space, GB/KByte pages = M entries bit bits for offset = bits page# Need ~bytes per entry (bit frame number & control bits) MB needed for page table Fit in SRAM? Put in main memory! IA Example: bit addresses KB Pages ( bits) bit V Page (M pages, GB) Up to bit P Page (M pages, GB) bits bits
12 Fast Address Translation: the TLB Even Worse when we have caches! But we know how to solve this: Cache the page table entries! Could be done in the cache but same problem accesses A better solution: Translation Lookaside Buffer (TLB) Small: 6-8entry, fully associative (low miss rate), strong locality Tagged with virtual page numbers Hit returns the physical page number Miss loads the PPN from the page table and associates with VPN. Advantages: address translation separate from cache access all entries in one place (TLB shootdown, flush, purge, invalidate) protection & control bits handy Address Translation Address in Translation the TLB via PT in Memory TLB Address Translation via cached PT CPU Cache (fast) Memory (DRAM-slow) V Page P Page P bits Tag Result
13 Hiding address translation Physical Cache Virtual Cache Virtually indexed, Physically Tagged VA PA PA CPU TLB Cache (L) Memory VA VA PA CPU Cache (L) TLB Memory CPU Cache blk bits V Page Offset TLB Cache (L) hit P Page =? P TAG VA PA miss Memory Tags are Virtual addr. Tags are Physical addr. Penalize only cache misses All programs use same VAs: Penalize all cache Same VAs referring to different PAs Accesses! Synonym problem: Different VAs referring to Same PA Deleting page mappings, Coherence (TBD in the next course)! Tags are Physical but cache is indexed w/ Virtual: Best of both worlds But: limits index to un-translated Offset can expand cache size via Assoc or exceed this limit and handle synonyms (AMD does this )
14 Interim Summary VM Exploiting locality on a large scale and offering protection at the same time Programmers want a large, flat address space but they ll use it sparsely, unpredictably! Key fetures: Offer each program is own virtual address space Demand Page sparse working set into RAM from DISK Key implementation issues: Mapping is Fully Associative need an indirection table, the Page Table Address translation needs to happen fast cache the page table into a specialized buffer, the TLB Can be further hidden behind the L cache access Page faults are slow and best handled by the OS VM essential in modern computers
15 Protection Basic tenet for protection: Separation of user space and supervisor (superuser, OS) space Programs can play in their sandbox but are not allowed to touch others OS: unrestricted privileges VM offers protection: by separating the address spaces of programs each program is given its own page table (mapping) which is wholly controlled by the OS by differentiating among User/Super pages & RO/RW pages How is it done?
16 Protection: How it is done (in Linux, Windows, ): GB address space (-bit IA) DRAM User pages USER GB Page table u s OS pages User program cannot touch these! Supervisor OS GB U/S bit
17 Protection: How it is done (in Linux, Windows, ): GB address space (-bit IA) DRAM User pages USER USER GB GB u Page table u s s OS pages Supervisor OS GB U/S bit Page Tables differ only in their upper part (user space) The OS part is identical
18 Protection: How it is done (in Linux, Windows, ): GB address space (-bit IA) DRAM User pages USER USER GB GB OS pages Sanity Check # How big Supervisor are these page table? A: MB for OS bit A.S. We need many GB(one per process) Another example: 6bit AS Alpha 6 maps ^8 pages GB page table! Still need multiple of those But they are mostly empty PAGE THE PAGE TABLES TOO!!! u u s s Another Reason Why This Is Not Simply Just a Good Idea But a Must! OS is only-one that can touch the page tables The Page Table Maps and Pages Itself! But the OS is also a program living in a Virtual Address Space Page Tables Need to APPEAR in OS s VM! and as such are also subject to PAGING
19 Paging the Page Table: -level hierarchical page tables VA V Page Offset bits Page Table Physical Address Space (DRAM) P. Page VPage ( bits) index IA Example: bit addresses KB Pages ( bits) bit V Page (M pages, GB) Up to bit P Page (M pages, GB) M entries x Bytes/entry MB (bit P.Page + protection/control bits = Bytes)
20 Paging the Page Table: -level hierarchical page tables (cont.) V Page VA Offset Page Table PT PAGE entries: KB Physical Address Space (DRAM) Divide the Page table Into KB Pages PT PAGE entries: KB PT PAGE entries: KB M entries x Bytes/entry MB (bit P.Page + protection/control bits = Bytes) KB tables MB
21 Paging the Page Table: -level hierarchical page tables (cont.) V Page VA Offset Page Table Physical Address Space (DRAM) Map the pages on Physical Mem
22 Paging the Page Table: -level hierarchical page tables (cont.) V Page VA Offset Page Table Physical Address Space (DRAM) There is a special Page Table Page Page Table Directory or Root Page Table: entries, KB, page Directory Just changing the CR (pointing to another directory in physical memory) changes the whole page table! Tells us where the pages of the PAGE TABLE are (The TLB is flushed and reload anew) CR PA Looks Familiar? It sure does, it s the same as the mapping of a virtual address space only just MB (instead of GB) are mapped Itself mapped (always resident) in Physical memory It s Location in Physical Memory is known, and held in a special register (let s call it CR) The only Physical Address inside the processor!!
23 Address Translation in -level hierarchical page tables (cont.) VA V Page bits bits bits Dir entry PT entry Offset Page Table + Physical Address Space (DRAM) Offset Directory bits + bits PT entry CR + + Dir entry + + CR Can be generalized to more levels (e.g., ALPHA cah have or levels) TLB operation remains unaffected! Still pairs VPage (bits) to (the final) PPage
24 Paging in Windows Page Table (MB) USER KERNEL VIRTUAL x x x x x x5 x6 x7 x8 WinNT x9 xa xb xc xd xe xf MB 6 x MB Pages (56MB) Mapped - xc xcfffff (MB) KB xc Physical x x x x x x5 x6 x7 x8 x9 xa xb xc xd xe xf The Directory is the PT Page that maps the MB of where the PT resides in VM
25 Summary VM Exploiting locality on a large scale and offering protection at the same time Programmers want a large, flat address space but they ll use it sparsely, unpredictably! Key fetures: Offer each program is own virtual address space Demand Page sparse working set into RAM from DISK Key implementation issues: Mapping is Fully Associative need an indirection table, the Page Table Address translation needs to happen fast cache the page table into a specialized buffer, the TLB Can be further hidden behind the L cache access Page faults are slow and best handled by the OS Protection from multiple address spaces, protected OS pages, individual access rights per page Protection comes from the fact that only the OS can touch page tables Page tables need to be paged too! For size and OS virtual access multi-level page tables, with page tables for the page table, called directories VM essential in modern computers
Virtual Memory Fall /19/0. L21 Virtual Memory 1
Virtual Memory L21 Virtual Memory 1 Lessons from History There is only one mistake that can be made in computer design that is difficult to recover from not having enough address bits for memory addressing
More informationVirtual 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 informationVirtual 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 informationVirtual 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 informationVirtual Memory, Address Translation
Memory Hierarchy Virtual Memory, Address Translation Slides contents from: Hennessy & Patterson, 5ed Appendix B and Chapter 2 David Wentzlaff, ELE 475 Computer Architecture MJT, High Performance Computing,
More information198: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 informationAddress Translation. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University
Address Translation Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics How to reduce the size of page tables? How to reduce the time for
More informationVirtual 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 informationVirtual Memory. Study Chapters something I understand. Finally! A lecture on PAGE FAULTS! doing NAND gates. I wish we were still
Virtual Memory I wish we were still doing NAND gates Study Chapters 7.4-7.8 Finally! A lecture on something I understand PAGE FAULTS! L23 Virtual Memory 1 You can never be too rich, too good looking, or
More informationChapter 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 informationVirtual Memory. Motivation:
Virtual Memory Motivation:! Each process would like to see its own, full, address space! Clearly impossible to provide full physical memory for all processes! Processes may define a large address space
More informationVirtual Memory. Samira Khan Apr 27, 2017
Virtual Memory Samira Khan Apr 27, 27 Virtual Memory Idea: Give the programmer the illusion of a large address space while having a small physical memory So that the programmer does not worry about managing
More informationVirtual Memory, Address Translation
Memory Hierarchy Virtual Memory, Address Translation Slides contents from: Hennessy & Patterson, 5ed Appendix B and Chapter 2 David Wentzlaff, ELE 475 Computer Architecture MJT, High Performance Computing,
More informationVIRTUAL MEMORY II. Jo, Heeseung
VIRTUAL MEMORY II Jo, Heeseung TODAY'S TOPICS How to reduce the size of page tables? How to reduce the time for address translation? 2 PAGE TABLES Space overhead of page tables The size of the page table
More informationVirtual 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 informationVirtual 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 informationVirtual 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 informationVirtual 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 informationVirtual 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 informationChapter 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 informationCS 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 informationAddress Translation. Tore Larsen Material developed by: Kai Li, Princeton University
Address Translation Tore Larsen Material developed by: Kai Li, Princeton University Topics Virtual memory Virtualization Protection Address translation Base and bound Segmentation Paging Translation look-ahead
More informationCS 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 informationMain 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 informationVirtual Memory. Study Chapters Recap: Memory Hierarchy of a Modern Computer System
Comp 120, Spring 2005 4/14 Lecture page 1 Virtual Memory I wish we were still doing NAND gates Finally! A lecture on something I understand PAGE FAULTS! Study Chapters 7.4-7.6 L21 Virtual Memory 1 Recap:
More information14 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 informationvirtual 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 informationComputer 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 informationRandom-Access Memory (RAM) Systemprogrammering 2007 Föreläsning 4 Virtual Memory. Locality. The CPU-Memory Gap. Topics
Systemprogrammering 27 Föreläsning 4 Topics The memory hierarchy Motivations for VM Address translation Accelerating translation with TLBs Random-Access (RAM) Key features RAM is packaged as a chip. Basic
More informationMemory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"
Memory Management! Goals of this Lecture! Help you learn about:" The memory hierarchy" Spatial and temporal locality of reference" Caching, at multiple levels" Virtual memory" and thereby " How the hardware
More informationCOSC3330 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 informationCISC 360. Virtual Memory Dec. 4, 2008
CISC 36 Virtual Dec. 4, 28 Topics Motivations for VM Address translation Accelerating translation with TLBs Motivations for Virtual Use Physical DRAM as a Cache for the Disk Address space of a process
More informationRandom-Access Memory (RAM) Systemprogrammering 2009 Föreläsning 4 Virtual Memory. Locality. The CPU-Memory Gap. Topics! The memory hierarchy
Systemprogrammering 29 Föreläsning 4 Topics! The memory hierarchy! Motivations for VM! Address translation! Accelerating translation with TLBs Random-Access (RAM) Key features! RAM is packaged as a chip.!
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient
More informationECE 571 Advanced Microprocessor-Based Design Lecture 13
ECE 571 Advanced Microprocessor-Based Design Lecture 13 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 21 March 2017 Announcements More on HW#6 When ask for reasons why cache
More informationVirtual Memory. Study Chapter Finally! A lecture on something I understand PAGE FAULTS! I wish we were still doing NAND gates
Virtual Memory I wish we were still doing NAND gates Finally! A lecture on something I understand PAGE FAULTS! Study Chapter 5.4-5.5 L21 Virtual Memory 1 You can never be too rich, too good looking, or
More informationMemory 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 informationSystems Programming and Computer Architecture ( ) Timothy Roscoe
Systems Group Department of Computer Science ETH Zürich Systems Programming and Computer Architecture (252-6-) Timothy Roscoe Herbstsemester 26 AS 26 Virtual Memory 8: Virtual Memory Computer Architecture
More informationVirtual 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 informationCS 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 informationCS 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 informationLearning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.
Virtual Memory 1 Learning Outcomes An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory. 2 Memory Management Unit (or TLB) The position and function
More informationVirtual Memory. Motivations for VM Address translation Accelerating translation with TLBs
Virtual Memory Today Motivations for VM Address translation Accelerating translation with TLBs Fabián Chris E. Bustamante, Riesbeck, Fall Spring 2007 2007 A system with physical memory only Addresses generated
More informationCache Architectures Design of Digital Circuits 217 Srdjan Capkun Onur Mutlu http://www.syssec.ethz.ch/education/digitaltechnik_17 Adapted from Digital Design and Computer Architecture, David Money Harris
More information1. 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 informationVirtual Memory. CS 351: Systems Programming Michael Saelee
Virtual Memory CS 351: Systems Programming Michael Saelee registers cache (SRAM) main memory (DRAM) local hard disk drive (HDD/SSD) remote storage (networked drive / cloud) previously: SRAM
More informationLearning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.
Virtual Memory Learning Outcomes An understanding of page-based virtual memory in depth. Including the R000 s support for virtual memory. Memory Management Unit (or TLB) The position and function of the
More informationLECTURE 12. Virtual Memory
LECTURE 12 Virtual Memory VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a cache for magnetic disk. The mechanism by which this is accomplished
More informationVirtual Memory Nov 9, 2009"
Virtual Memory Nov 9, 2009" Administrivia" 2! 3! Motivations for Virtual Memory" Motivation #1: DRAM a Cache for Disk" SRAM" DRAM" Disk" 4! Levels in Memory Hierarchy" cache! virtual memory! CPU" regs"
More informationCOMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy
COMPUTER ARCHITECTURE Virtualization and Memory Hierarchy 2 Contents Virtual memory. Policies and strategies. Page tables. Virtual machines. Requirements of virtual machines and ISA support. Virtual machines:
More informationThis Unit: Main Memory. Virtual Memory. Virtual Memory. Other Uses of Virtual Memory
This Unit: Virtual Application OS Compiler Firmware I/O Digital Circuits Gates & Transistors hierarchy review DRAM technology A few more transistors Organization: two level addressing Building a memory
More informationCISC 662 Graduate Computer Architecture Lecture 16 - Cache and virtual memory review
CISC 662 Graduate Computer Architecture Lecture 6 - Cache and virtual memory review Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David
More informationComputer Science 146. Computer Architecture
Computer Architecture Spring 2004 Harvard University Instructor: Prof. dbrooks@eecs.harvard.edu Lecture 18: Virtual Memory Lecture Outline Review of Main Memory Virtual Memory Simple Interleaving Cycle
More informationvirtual memory Page 1 CSE 361S Disk Disk
CSE 36S Motivations for Use DRAM a for the Address space of a process can exceed physical memory size Sum of address spaces of multiple processes can exceed physical memory Simplify Management 2 Multiple
More informationMotivations for Virtual Memory Virtual Memory Oct. 29, Why VM Works? Motivation #1: DRAM a Cache for Disk
class8.ppt 5-23 The course that gives CMU its Zip! Virtual Oct. 29, 22 Topics Motivations for VM Address translation Accelerating translation with TLBs Motivations for Virtual Use Physical DRAM as a Cache
More informationCPS104 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 informationModule 2: Virtual Memory and Caches Lecture 3: Virtual Memory and Caches. The Lecture Contains:
The Lecture Contains: Program Optimization for Multi-core: Hardware Side of It Contents RECAP: VIRTUAL MEMORY AND CACHE Why Virtual Memory? Virtual Memory Addressing VM VA to PA Translation Page Fault
More informationCSE 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 informationMemory Management! Goals of this Lecture!
Memory Management! Goals of this Lecture! Help you learn about:" The memory hierarchy" Why it works: locality of reference" Caching, at multiple levels" Virtual memory" and thereby " How the hardware and
More informationEITF20: Computer Architecture Part 5.1.1: Virtual Memory
EITF20: Computer Architecture Part 5.1.1: Virtual Memory Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Cache optimization Virtual memory Case study AMD Opteron Summary 2 Memory hierarchy 3 Cache
More informationSarah L. Harris and David Money Harris. Digital Design and Computer Architecture: ARM Edition Chapter 8 <1>
Chapter 8 Digital Design and Computer Architecture: ARM Edition Sarah L. Harris and David Money Harris Digital Design and Computer Architecture: ARM Edition 215 Chapter 8 Chapter 8 :: Topics Introduction
More informationEITF20: Computer Architecture Part 5.1.1: Virtual Memory
EITF20: Computer Architecture Part 5.1.1: Virtual Memory Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Virtual memory Case study AMD Opteron Summary 2 Memory hierarchy 3 Cache performance 4 Cache
More informationCSE 120 Principles of Operating Systems Spring 2017
CSE 120 Principles of Operating Systems Spring 2017 Lecture 12: Paging Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient translations (TLBs)
More informationAgenda. 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 informationVirtual 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 informationMulti-level Translation. CS 537 Lecture 9 Paging. Example two-level page table. Multi-level Translation Analysis
Multi-level Translation CS 57 Lecture 9 Paging Michael Swift Problem: what if you have a sparse address space e.g. out of GB, you use MB spread out need one PTE per page in virtual address space bit AS
More informationCarnegie 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 informationCSE 351. Virtual Memory
CSE 351 Virtual Memory Virtual Memory Very powerful layer of indirection on top of physical memory addressing We never actually use physical addresses when writing programs Every address, pointer, etc
More informationNew-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 informationCPS 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 informationVirtual 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 informationV. 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 informationCS 318 Principles of Operating Systems
CS 318 Principles of Operating Systems Fall 2018 Lecture 10: Virtual Memory II Ryan Huang Slides adapted from Geoff Voelker s lectures Administrivia Next Tuesday project hacking day No class My office
More informationEN1640: Design of Computing Systems Topic 06: Memory System
EN164: Design of Computing Systems Topic 6: Memory System Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring
More informationCS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck
Main memory management CMSC 411 Computer Systems Architecture Lecture 16 Memory Hierarchy 3 (Main Memory & Memory) Questions: How big should main memory be? How to handle reads and writes? How to find
More informationCS 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 informationChapter 8 :: Topics. Chapter 8 :: Memory Systems. Introduction Memory System Performance Analysis Caches Virtual Memory Memory-Mapped I/O Summary
Chapter 8 :: Systems Chapter 8 :: Topics Digital Design and Computer Architecture David Money Harris and Sarah L. Harris Introduction System Performance Analysis Caches Virtual -Mapped I/O Summary Copyright
More informationECE331: Hardware Organization and Design
ECE331: Hardware Organization and Design Lecture 29: an Introduction to Virtual Memory Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Virtual memory used to protect applications
More informationCache 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 informationVirtual Memory 1. Virtual Memory
Virtual Memory 1 Virtual Memory key concepts virtual memory, physical memory, address translation, MMU, TLB, relocation, paging, segmentation, executable file, swapping, page fault, locality, page replacement
More informationECE232: Hardware Organization and Design
ECE232: Hardware Organization and Design Lecture 28: More Virtual Memory Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Virtual memory used to protect applications from
More informationVirtual Memory 1. Virtual Memory
Virtual Memory 1 Virtual Memory key concepts virtual memory, physical memory, address translation, MMU, TLB, relocation, paging, segmentation, executable file, swapping, page fault, locality, page replacement
More informationVirtual Memory 3. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. P & H Chapter 5.4
Virtual Memory 3 Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University P & H Chapter 5.4 Project3 available now Administrivia Design Doc due next week, Monday, April 16 th Schedule
More informationPage 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 informationSE-292 High Performance Computing. Memory Hierarchy. R. Govindarajan
SE-292 High Performance Computing Memory Hierarchy R. Govindarajan govind@serc Reality Check Question 1: Are real caches built to work on virtual addresses or physical addresses? Question 2: What about
More informationECE 571 Advanced Microprocessor-Based Design Lecture 12
ECE 571 Advanced Microprocessor-Based Design Lecture 12 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 1 March 2018 HW#6 will be posted Project will be coming up Announcements
More informationJohn 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 informationMemory Management. Goals of this Lecture. Motivation for Memory Hierarchy
Memory Management Goals of this Lecture Help you learn about: The memory hierarchy Spatial and temporal locality of reference Caching, at multiple levels Virtual memory and thereby How the hardware and
More informationProcesses 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 informationChapter 8 Virtual Memory
Chapter 8 Virtual Memory Digital Design and Computer Architecture: ARM Edi*on Sarah L. Harris and David Money Harris Digital Design and Computer Architecture: ARM Edi>on 215 Chapter 8 Chapter 8 ::
More informationEN1640: Design of Computing Systems Topic 06: Memory System
EN164: Design of Computing Systems Topic 6: Memory System Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring
More informationCHAPTER 4 MEMORY HIERARCHIES TYPICAL MEMORY HIERARCHY TYPICAL MEMORY HIERARCHY: THE PYRAMID CACHE PERFORMANCE MEMORY HIERARCHIES CACHE DESIGN
CHAPTER 4 TYPICAL MEMORY HIERARCHY MEMORY HIERARCHIES MEMORY HIERARCHIES CACHE DESIGN TECHNIQUES TO IMPROVE CACHE PERFORMANCE VIRTUAL MEMORY SUPPORT PRINCIPLE OF LOCALITY: A PROGRAM ACCESSES A RELATIVELY
More informationCS5460: Operating Systems Lecture 14: Memory Management (Chapter 8)
CS5460: Operating Systems Lecture 14: Memory Management (Chapter 8) Important from last time We re trying to build efficient virtual address spaces Why?? Virtual / physical translation is done by HW and
More informationDigital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 8-<1>
Digital Logic & Computer Design CS 4341 Professor Dan Moldovan Spring 21 Copyright 27 Elsevier 8- Chapter 8 :: Memory Systems Digital Design and Computer Architecture David Money Harris and Sarah L.
More informationRoadmap. Java: Assembly language: OS: Machine code: Computer system:
Roadmap C: car *c = malloc(sizeof(car)); c->miles = ; c->gals = 7; float mpg = get_mpg(c); free(c); Assembly language: Machine code: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp %rbp Java: Car c = new
More informationComputer Architecture. Memory Hierarchy. Lynn Choi Korea University
Computer Architecture Memory Hierarchy Lynn Choi Korea University Memory Hierarchy Motivated by Principles of Locality Speed vs. Size vs. Cost tradeoff Locality principle Temporal Locality: reference to
More informationCS 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 informationCS 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 informationBackground. Memory Hierarchies. Register File. Background. Forecast Memory (B5) Motivation for memory hierarchy Cache ECC Virtual memory.
Memory Hierarchies Forecast Memory (B5) Motivation for memory hierarchy Cache ECC Virtual memory Mem Element Background Size Speed Price Register small 1-5ns high?? SRAM medium 5-25ns $100-250 DRAM large
More informationand data combined) is equal to 7% of the number of instructions. Miss Rate with Second- Level Cache, Direct- Mapped Speed
5.3 By convention, a cache is named according to the amount of data it contains (i.e., a 4 KiB cache can hold 4 KiB of data); however, caches also require SRAM to store metadata such as tags and valid
More information