Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by Phil Howard.

Slides:



Advertisements
Similar presentations
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Virtual Memory Primitives for User Programs Andrew Appel and Kai Li Princeton U. Appears in ASPLOS.
Advertisements

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.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
Virtual Memory Management
1 Operating Systems and Protection CS Goals of Today’s Lecture How multiple programs can run at once  Processes  Context switching  Process.
G Robert Grimm New York University Cool Pet Tricks with… …Virtual Memory.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by: Khanh Nguyen.
Virtual Memory Art Munson CS614 Presentation February 10, 2004.
1 Operating Systems and Protection Professor Jennifer Rexford CS 217.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Memory Management 2010.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
CS533 - Concepts of Operating Systems Virtual Memory Primitives for User Programs Presentation by David Florey.
Memory Management 3 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
Operating Systems ECE344 Ding Yuan Paging Lecture 8: Paging.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
1 Linux Operating System 許 富 皓. 2 Memory Addressing.
Lecture 11 Page 1 CS 111 Online Memory Management: Paging and Virtual Memory CS 111 On-Line MS Program Operating Systems Peter Reiher.
Chapter 4 Memory Management Virtual Memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Lecture 11 Page 1 CS 111 Online Working Sets Give each running process an allocation of page frames matched to its needs How do we know what its needs.
Virtual Memory Additional Slides Slide Source: Topics Address translation Accelerating translation with TLBs class12.ppt.
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Processes and Virtual Memory
Operating Systems Lesson 5. Plan Memory Management ◦ Memory segments types ◦ Processes & Memory ◦ Virtual Memory ◦ Virtual Memory Management ◦ Swap File.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Lecture 19 Virtual Memory Demand Paging. Background Virtual memory – separation of user logical memory from physical memory. –Only part of the program.
Carnegie Mellon 1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Virtual Memory: Concepts Slides adapted from Bryant.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
Constructive Computer Architecture Virtual Memory: From Address Translation to Demand Paging Arvind Computer Science & Artificial Intelligence Lab. Massachusetts.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
Virtual Memory 1 Computer Organization II © McQuain Virtual Memory Use main memory as a “cache” for secondary (disk) storage – Managed jointly.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Virtual Memory CSSE 332 Operating Systems
CSE 120 Principles of Operating
From Address Translation to Demand Paging
CS703 - Advanced Operating Systems
Outline Paging Swapping and demand paging Virtual memory.
Section 9: Virtual Memory (VM)
Chapter 9: Virtual Memory
Today How was the midterm review? Lab4 due today.
Modeling Page Replacement Algorithms
Introduction to Operating Systems
CSE 153 Design of Operating Systems Winter 2018
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 9: Virtual-Memory Management
Page Replacement.
CS399 New Beginnings Jonathan Walpole.
Modeling Page Replacement Algorithms
Chapter 9: Virtual Memory
Architectural Support for OS
CSE 451: Operating Systems Autumn 2005 Memory Management
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Architectural Support for OS
CSE 153 Design of Operating Systems Winter 2019
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.
4.3 Virtual Memory.
Chapter 8 & 9 Main Memory and Virtual Memory
Presentation transcript:

Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by Phil Howard

Virtual Memory A brief history Programmer Control Compiler Control System Control New Applications Concurrent Garbage Collection Shared Virtual Memory Concurrent Checkpointing Persistent Heap Extending Addressing Data Compression Paging Conclusions

Programmer Controlled Memory 16 bit address space 17 bit program size

Programmer Controlled Memory foo() { } bar() { } main() { foo(); bar(); }

Compiler Controlled Memory 20 bit physical memory 16 bit address space

Compiler Controlled Memory Program Counter Program Segment

Compiler Controlled Memory Call: push PC load PC with effective address Return: pop PC

Compiler Controlled Memory Call: push PC push PS load PS,PC with effective address push DS Return: pop DS pop PS,PC

System Controlled Memory 32 bit address space 1M physical memory

System Controlled Memory CPUMMU RAM Virtual Address Physical Address

System Controlled Memory System handles page faults Allowed protection You can't see my pages You can't change my pages I can't execute my data I can't change my program Made life much easier for programmers

But wait… Appel and Li want to control memory themselves Why?

User access to VM primitives TRAP - Handle page fault PROT1 - Protect a single page PROTN - Protect many pages UNPROT - Unprotect single page DIRTY - return list of dirty pages MAP2 - Map a page to two addresses

Concurrent Garbage Collection Heap FromTo root

Concurrent Garbage Collection Heap FromTo root

Concurrent Garbage Collection Mutator sees only to-space pointers New objects contain to-space pointers only Objects in to-space contain to-space pointers only Objects in from-space contain from-space and to-space pointers Invariants

Concurrent Garbage Collection Use VM to protect from-space Collector handles access violations, validates objects and updates pointers Collector uses aliased addresses to scan in background

Shared Virtual Memory CPU Memory Mapping Manager Shared Virtual Memory CPU Memory Mapping Manager CPU Memory Mapping Manager

Shared Virtual Memory Coherent across processors - each read gets the last value written Multiple readers/Single writer Handled the same as "regular" VM except for fetching and writing pages

Concurrent Checkpointing Stop all threads Save all thread states Save all memory Restart threads Stop all threads Save all thread states Make all memory read-only Restart threads Save pages in the "background" and mark as read/write

Persistent Heap Heap survives across process invocations Read/Write access as fast as conventional heap Use memory mapped disk file Page faults fetch from heap file instead of system page file

Extending Addressability Persistent Heap with > 2 32 objects Need translation table to convert from 32 to 64 bit address Page fault fetches from Persistent Heap and sets up translation Application limited to 2 32 objects per invocation

Data Compression Paging Paging is slow - 20 ms seek time on disk plus transfer time Many data pages can be compressed 4:1 Instead of swapping out a page, compress it Page fault to compressed page will decompress it rather than read from disk

VM Primitive Performance Garbage collection for 4096 byte page = 500  sec

VM Primitive Performance

OS Authors didn't pay much attention to VM Performance Why? Seek time ~ 20 msec Read time ~ 1 msec Page fault happens in parallel with another task Why do we care? Many of the algorithms in this paper don't involve the disk

Conclusions "… page-protection and fault-handling efficiency must be considered as one of the parameters of the design space." "It is important that hardware and operating system designers make the virtual memory mechanisms required by these algorithms robust, and efficient."

Conclusions "… page-protection and fault-handling efficiency must be considered as one of the parameters of the design space." "It is important that hardware and operating system designers make the virtual memory mechanisms required by these algorithms robust, and efficient."