G22.3250-001 Robert Grimm New York University Virtual Memory.

Slides:



Advertisements
Similar presentations
MACHINE-INDEPENDENT VIRTUAL MEMORY MANAGEMENT FOR PAGED UNIPROCESSOR AND MULTIPROCESSOR ARCHITECTURES R. Rashid, A. Tevanian, M. Young, D. Golub, R. Baron,
Advertisements

Machine-Independent Virtual Memory Management for Paged Uniprocessor and Multiprocessor Architectures Jordan Acedera Ishmael Davis Justin Augspurger Karl.
OS Fall’02 Virtual Memory Operating Systems Fall 2002.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
The Memory Hierarchy (Lectures #24) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer Organization.
Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.
Memory Management (II)
Computer ArchitectureFall 2008 © November 10, 2007 Nael Abu-Ghazaleh Lecture 23 Virtual.
By: Richard Rashid, Avadis Tevanian, Michael Young, David Golub, Robert Baronn, David Black, William Bolosky, and Jonathan Chew, October 1987 Presented.
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Memory Management 2010.
Chapter 3.2 : Virtual Memory
Translation Buffers (TLB’s)
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Virtual Memory and Paging J. Nelson Amaral. Large Data Sets Size of address space: – 32-bit machines: 2 32 = 4 GB – 64-bit machines: 2 64 = a huge number.
Computer Organization and Architecture
CS533 Concepts of Operating Systems Class 14 Extensible Virtual Memory Management.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Paging. Memory Partitioning Troubles Fragmentation Need for compaction/swapping A process size is limited by the available physical memory Dynamic growth.
Mac OS X Panther Operating System
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
Lecture 19: Virtual Memory
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
© 2004, D. J. Foreman 1 Virtual Memory. © 2004, D. J. Foreman 2 Objectives  Avoid copy/restore entire address space  Avoid unusable holes in memory.
Virtual Memory 1 Chapter 13. Virtual Memory Introduction Demand Paging Hardware Requirements 4.3 BSD Virtual Memory 4.3 BSD Memory Management Operations.
A summary by Nick Rayner for PSU CS533, Spring 2006
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
1 Machine-Independent Virtual Memory Management of Paged Uniprocessor and Multiprocessor Architectures by Rashid, Tevanian, Young, Golub, Baron, Black,
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Processes and Virtual Memory
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Virtual Memory 1 Computer Organization II © McQuain Virtual Memory Use main memory as a “cache” for secondary (disk) storage – Managed jointly.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Virtual Memory Chapter 8.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Page Table Implementation
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Morgan Kaufmann Publishers
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Computer Architecture
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Lecture 29: Virtual Memory-Address Translation
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2005 Memory Management
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Contents Memory types & memory hierarchy Virtual memory (VM)
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2004 Page Tables, TLBs, and Other Pragmatics Hank Levy 1.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Translation Buffers (TLB’s)
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CS703 - Advanced Operating Systems
CSE 451: Operating Systems Winter 2005 Page Tables, TLBs, and Other Pragmatics Steve Gribble 1.
CS533 Concepts of Operating Systems Class 14
Virtual Memory Lecture notes from MKP and S. Yalamanchili.
Translation Buffers (TLBs)
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
COMP755 Advanced Operating Systems
Review What are the advantages/disadvantages of pages versus segments?
Virtual Memory 1 1.
Presentation transcript:

G Robert Grimm New York University Virtual Memory

Altogether Now: The Three Questions  What is the problem?  What is new or different?  What are the contributions and limitations?

VAX-11 Memory Hardware  Each process has a 32-bit virtual address space  Divided into 512-byte pages  Each address consists of  2-bit region identifier  P0 program region  P1 control region  System region  Reserved space  21-bit virtual page number  9-bit byte offset within page

VAX-11 Memory Hardware (cont.)  Each region has its own page table (why?)  Base address register  Length register  Each page table entry consist of  Valid bit (PTE )  Protection field (PTE )  Modify bit (PTE )  OS field (PTE )  Physical frame number (PTE )

VAX-11 Memory Hardware (cont.)  System page table is in physical memory  P0 and P1 page tables are in virtual memory  Two accesses per address translation (which?)  Translation buffer  Divided into system and per-process translations  What entries need to be flushed on a context switch?

Memory Management Concerns  Containing the effects of heavily paging programs  Reducing the cost of program startup  Reducing the disk workload of paging  Reducing the processor time searching page tables  Amplified by minicomputer hardware  Slow CPU  Slow and limited number of disks  But memory size easily changed

The VAX/VMS Pager  Process-local replacement  To contain paging behavior  Backed by resident-set list  Organized as FIFO, not as LRU  How is LRU commonly implemented?  Why not LRU?  Which page is evicted on a page fault?  Complemented by free and modified page lists  Caches of recently used pages, added to tails  Simulation studies show that private free lists can approximate LRU replacement with arbitrary precision  Are these lists per-process or global?

Clustering of Pages  To reduce I/O workload, pages should be read/written in groups  For reading executables  Linker lays out pages consecutively (if possible)  Pager reads pages in one operation (if possible)  Same for paging file  For reading and writing dirty pages  Modified page list has low and high watermark  Pager writes pages when list reaches high watermark, combining consecutive pages into single writes  Virtually or physically consecutive?

Modified Page List + Lazy Writing Is a Good Thing   Serves as a cache of recently removed pages  Minimal cost for cache hits  Supports the batching of writes  Writes are cheaper  Supports clustering in paging file  Reads are cheaper as well  Avoids unnecessary writes  Page may be used again, program terminates

The Swapper  Moves entire resident sets between memory and storage  Keeps higher priority processes resident  Reduces high paging rates in most paged systems  Entire resident set is loaded  Needs to be careful about ongoing I/O  What is the concern?

Back to Memory Management Concerns  Containing the effects of heavily paging programs  How is this achieved?  Reducing the cost of program startup  How is this achieved?  Reducing the disk workload of paging  How is this achieved?  Reducing the processor time searching page tables  How is this achieved?  Are these techniques effective?

Think Different: Mach’s VM

The Mach Microkernel  Five core abstractions  Tasks, threads, ports, messages, memory objects  One big challenge  Making the system perform well  Claim: Integration of VM with messaging is key

Mach Virtual Memory Features and Operations  Features  Large, sparse virtual address spaces  Copy-on-write  Read-write memory sharing  Memory mapped files  User-provided backing store objects and pagers  Operations  Allocating and de-allocating virtual memory  Setting protection status of VM  Setting inheritance for VM (shared, copy, none)  Managing memory objects

Implementation Strategy  Minimize state in machine-dependent data structures  The pmap: Hardware-defined physical address map  Machine-independent data structures  The resident page table: attributes of physical memory  Embedded memory object lists  Embedded allocation queues for free, reclaimable, allocated pages  Addresses expressed as bytes (why?)  The address map: doubly-linked list of virtual-to-memory- object mappings  Sorted by virtual address  Includes inheritance and protection attributes

Implementation Strategy (cont.)  Machine-independent data structures (cont.)  Memory objects: repositories of actual data  Reference-counted  Cached after last unmapping (for frequently used memory objects)  Controlled by pager (e.g., to implement memory-mapped files)  Special support for memory sharing  Shadow objects: list of modified pages for copy-on-write  Sharing maps: level of indirection for read/write shared memory  Together they add quite some complexity to implementation

The pmap Module  Necessary to interact with real hardware  But maintains only soft state (!)  All page tables can be reconstructed from other VM data structures  With the exception of kernel mappings  Must be accurate

Some Uniprocessor Issues  VAX has very small pages  very large tables  Construct only those that are actually used  IBM RT PC has inverted page table  Need to treat page table as software TLB due to VM aliasing (why?)  SUN 3 has holes in physical memory  Need to treat page table as sparse data structure

One Multiprocessor Issue  How to ensure consistency of mappings across processors?  Machines have no support for TLB consistency  Mach needs to track TLB contents and propagate changes  Forcibly interrupt CPUs on time critical changes  Change mappings on timer interrupt for, say, pageouts  Allow inconsistency for protection changes

What Do You Think?