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

Slides:



Advertisements
Similar presentations
Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
G Robert Grimm New York University Virtual Memory.
Machine-Independent Virtual Memory Management for Paged Uniprocessor and Multiprocessor Architectures Jordan Acedera Ishmael Davis Justin Augspurger Karl.
Caching and Virtual Memory. Main Points Cache concept – Hardware vs. software caches When caches work and when they don’t – Spatial/temporal locality.
Segmentation and Paging Considerations
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
By: Richard Rashid, Avadis Tevanian, Michael Young, David Golub, Robert Baronn, David Black, William Bolosky, and Jonathan Chew, October 1987 Presented.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
3.5 Interprocess Communication
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual Memory.
Memory Management April 28, 2000 Instructor: Gary Kimura.
Process Description and Control A process is sometimes called a task, it is a program in execution.
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.
Mac OS X Panther Operating System
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
The Duality of Memory and Communication in the Implementation of a Multiprocessor Operating System Michael Young, Avadis Tevanian, Richard Rashid, David.
30 October Agenda for Today Introduction and purpose of the course Introduction and purpose of the course Organization of a computer system Organization.
Computer Studies (AL) Memory Management Virtual Memory I.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Virtual Memory 1 Chapter 13. Virtual Memory Introduction Demand Paging Hardware Requirements 4.3 BSD Virtual Memory 4.3 BSD Memory Management Operations.
The Mach System Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Presentation By: Agnimitra Roy.
A summary by Nick Rayner for PSU CS533, Spring 2006
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Solutions for the First Quiz COSC 6360 Spring 2014.
1 Machine-Independent Virtual Memory Management of Paged Uniprocessor and Multiprocessor Architectures by Rashid, Tevanian, Young, Golub, Baron, Black,
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
The Mach System Silberschatz et al Presented By Anjana Venkat.
M a c O S X CS-450-1: Operating Systems Fall 2005 Matt Grady – Mike O’Connor – Justin Rains.
CS307 Operating Systems Virtual Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Kernel Design & Implementation
OPERATING SYSTEM CONCEPT AND PRACTISE
Virtual Memory CSSE 332 Operating Systems
Memory Management Paging (continued) Segmentation
Carnegie-Mellon University, Pittsburgh Presented by Mehmet Belgin
The Mach System Sri Ramkrishna.
Chapter 9: Virtual Memory – Part I
Chapter 9: Virtual Memory
OS Virtualization.
O.S Lecture 13 Virtual Memory.
Chapter 9: Virtual-Memory Management
Page Replacement.
Memory Management Paging (continued) Segmentation
Computer-System Architecture
What Happens if There is no Free Frame?
Chapter 9: Virtual Memory
Operating Systems Lecture 1.
Contents Memory types & memory hierarchy Virtual memory (VM)
CS533 Concepts of Operating Systems Class 14
Memory Management Paging (continued) Segmentation
Chapter 8 & 9 Main Memory and Virtual Memory
CSE 542: Operating Systems
Presentation transcript:

MACHINE-INDEPENDENT VIRTUAL MEMORY MANAGEMENT FOR PAGED UNIPROCESSOR AND MULTIPROCESSOR ARCHITECTURES R. Rashid, A. Tevanian, M. Young, D. Golub, R. Baron, D. Black, W. Bolosky and J. Chew Carnegie-Mellon University IEEE Trans. on Computers,1988

THE PAPER Presents the Mach virtual memory system Three most important issues: –Use of external pagers to support mapped files –Concept of inheritance – Copy on write Shortened version of A. Tevanian’s dissertation

GENERAL OBJECTIVES To be as portable as the UNIX virtual memory system while supporting more functionality: –Mapped files –Threads through page inheritance To support multiprocessing, distributed systems and large address spaces

Virtual Memory and I/O Buffering (I) Current situation: Swap area Process in main memory I /O buffer Disk Drive System calls Virtual Memory

Virtual Memory and I/O Buffering (II) In a VM system, we have – Implicit transfers of data between main memory and swap area (page faults, etc.) – Implicit transfers of information between the disk drive and the system I/O buffer – Explicit transfers of information between the I/O buffer and the process address space

Virtual Memory and I/O Buffering (III) I/O buffering greatly reduces number of disk accesses Each I/O request must still be serviced by the OS: –Two context switches per I/O request A better solution consists of mapping files in the process virtual address space

Mapped files (I) Swap area Process in main memory “External” Pager Disk Drive Usual VM Pager

Mapped files (II) When a process opens a file, the whole file is mapped into the process virtual address space – No data transfer takes place File blocks are brought in memory on demand File contents are accessed using regular program instructions (or library functions) Shared files are in shared memory segments

Mach implementation Swap area Process virtual address space “External” Pager File System Usual VM Pager

Comments Solution requires very large address spaces Most programs will continue to access files through calls to read() and write() –Function calls instead of system calls Two major problems –Harder to know the exact size of a file –Much harder to emulate the UNIX consistency model in a distributed file system How can we have atomic writes?

Threads Also known as lightweight processes Share the address space of their parent Can be –Kernel-supported –Implemented at user level Kernel-supported threads are essential in multiprocessor architectures

Mach VM user interface Consistent on all machines supporting Mach: including the features that cannot be efficiently implemented on a specific hardware Full support for multiprocessing: thread support, efficient data sharing mechanisms, etc.. Modular paging: external pagers are allowed to implement file mapping or recoverable virtual memory (for transaction management).

VM IMPLEMENTATION Main implementation problem was hardware incompatibilities BSD VM implementation was tailored to VAX hardware (and its lack of a page-referenced bit) Mach designers wanted a design that would be architecture neutral –Many competing microprocessor architectures were then available

Data structures Resident page table: keeps track of Mach pages residing in main memory Memory object: a unit of backing storage such as a disk file or a swap area Address map: a doubly linked list of map entries each of which maps a range of virtual addresses to a region of a memory object P-map: the memory-mapping data structure used by the hardware

The address map FirstCurrentLast First Offset FromToVM Object Protection Inheritance PreviousNext could map code segment (inheritance = share) could map stack segment (inheritance = copy) Offset FromToVM Object Protection Inheritance PreviousNext

Inheritance (I) After a regular UNIX fork() – code segment is shared between parent and child – child inherits a copy of data segment of parent Mach inheritance attribute specifies if pages in a given range of addresses are to be shared, copied or ignored

Inheritance (II) Pages of a mapped file are always shared between parent and child to preserve file sharing semantics Pages in the data segment can either be – copied to maintain UNIX fork() semantics – shared if we want to create a thread instead of a regular UNIX process

Lazy evaluation Mach VM system postpones execution of tasks whenever possible Approach is based on the belief that task is likely to become unnecessary –copying whole data segment of parent process in a fork() that is very likely to be followed by an exec() –Mach uses copy-on-write

Copy on write (I) Already present in Accent Best solution for efficient implementation of UNIX fork () When Mach is told to copy a range of pages, it lets processes share the same copy of each page but traps write accesses Only pages that are modified are copied

Copy on write (II) Process A and B share a range of pages Process B tries to modify shared page COW creates new copy X

Page replacement policy (I) Global pool of pages FIFO Global Queue Disk Expelled pages Reclaimed pages

Page replacement policy (II) Similar to that of VAX VMS –Requires little hardware support Major change is global FIFO pool replacing resident sets of all programs –Much easier to tune –Does not support real-time processes –Can use external pagers

Locks and deadlocks Mach VM algorithms rely on locks to achieve exclusive access to kernel data structures –Price to pay for a parallel kernel To prevent deadlocks, all algorithms gain locks using the same linear ordering –Well known deadlock prevention technique

Miscellanea Total size of the machine-dependent part of Mach VM implementation is about 16 Kbytes. Copy-on-write is used to implement efficient message passing : –Messages are shared by sender and receiver until either of them modifies the data. Shared libraries are supported through the mapped file interface

Problem with inverted page table IBM RT had a single inverted page table for its whole memory – One page table entry per page frame –A page frame could not belong to two processes at the same time Cannot implement shared pages in an efficient fashion –Mach still offers the feature

FINAL COMMENTS Paper is hard to read but covers a lot of ground You should at least understand –mapped files –external pagers and memory objects –the concept of inheritance –copy-on-write –the Mach page replacement policy

More about Mach Mach provides UNIX emulation through either –a UNIX emulator in the kernel –a UNIX emulation server in user space Even tried to emulate UNIX through a set of specific servers, all in user space –GNU’s HURD