Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management Basic memory management Swapping
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.
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.
Virtual Memory Management G. Anuradha Ref:- Galvin.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
Module 9: Virtual Memory
Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing.
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.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
Memory/Storage Architecture Lab Computer Architecture Virtual Memory.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
CS 104 Introduction to Computer Science and Graphics Problems
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.
Translation Buffers (TLB’s)
©UCB CS 162 Ch 7: Virtual Memory LECTURE 13 Instructor: L.N. Bhuyan
Cute Tricks with Virtual Memory CS 614 9/7/06 by Ari Rabkin CS 614 9/7/06 by Ari Rabkin (and why they don’t work)
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
CS 153 Design of Operating Systems Spring 2015 Final Review.
Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum.
1 Micro-kernel. 2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation.
Lecture Topics: 11/17 Page tables TLBs Virtual memory flat page tables
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day14:
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.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Operating Systems Engineering Based on MIT (2012, lec3) Recitation 2: OS Organization.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
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.
Processes and Virtual Memory
The Mach System Silberschatz et al Presented By Anjana Venkat.
Demand Paging Reference Reference on UNIX memory management
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
CS533 Concepts of Operating Systems Jonathan Walpole.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
CS203 – Advanced Computer Architecture Virtual Memory.
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.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Introduction to Operating Systems Concepts
CS161 – Design and Architecture of Computer
MODERN OPERATING SYSTEMS Third Edition ANDREW S
ECE232: Hardware Organization and Design
CS161 – Design and Architecture of Computer
Chapter 9: Virtual Memory
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.
Demand Paging Reference Reference on UNIX memory management
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers
Demand Paging Reference Reference on UNIX memory management
Introduction Virtual Memory Basics Demand Paging
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 9: Virtual-Memory Management
Page Replacement.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Virtual Memory Overcoming main memory size limitation
Contents Memory types & memory hierarchy Virtual memory (VM)
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
CSC3050 – Computer Architecture
Computer Architecture
Virtual Memory Lecture notes from MKP and S. Yalamanchili.
CSE 542: Operating Systems
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.
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen

Virtual Memory  Decoupling processes and physical address space Two problems – One solution  Memory Management Process footprint grows to fill available memory  Isolation & Protection Processes need to be isolated from other Processes Resources need to be protected from Processes Papers: Focus on different issues Introduction Virtual addressPhysical address Mapping Function

Memory Management Problem: Not enough main memory  Copy data between main memory and disk Virtual Memory / Paging  Need only parts of process to execute  Process footprint -> pages  On demand pagein Page table  One entry per virtual page  X: Absent Virtual addressPhysical addressMMU Main Memory x x x x x

Importance Memory Management & CPU Utilization  Interleave i/o-bound processes  Effective MM => more processes may run concurrently Decrease probability that all block at the same time Future  Processes will continue to fight for physical memory

Isolation & Protection Isolate processes from each other  Mapping : Process address-spaces map into disjunct physical address-spaces Resource protection  Mapping : References protected by access control bits. Page frame # Present/AbsentModifiedReferenced Protection

Research Tradeoff pagesize  Too small huge pagetable, frequent page faults  Too big Less concurrency, costly pagein  0,5 – 64 KB Page Replacement Algorithms  NRU, FIFO, CLOCK, LRU, …

Research cont. Effective Pagetable implementation  Huge pagetable Pagesize 4KB, 32-bit address space => 1M entries  Fast pagetable lookup Evaluated on every memory reference  More than 1 memory reference per instruction Design options  Hardware registers + fast, - expensive, - context-switch penalty  Main memory + cheap, - extra memory ref, - steals precious memory  Something in between

Research cont. cont. Optimizations  Multilevel pagetable Pageout unused parts  Cashing Pagetable-entries in hardware TLB exploits locality. Very effective!  Inverted Page table (physical page frame -> virtual page) + Smaller, - Expensive to search  Software control of hardware TLB cashe management, pagefault handling

Research cont. cont. cont. Result  Multitude of hardware solutions  Multitude of software designs  Discussions What are the best solutions? Where to draw the line between HW and SW? User-level meddling in HW business? => Context of paper 1

Virtual MM in Mach Problem  Portability Strong dependencies between HW and OS Mach goals  Virtual Memory Management …on top of diverse HW architectures  Few HW assumptions  Clean HW/SW separation  Easy to port  No performance loss Approach  Experiences with building and porting Mach

Mach Virtual Memory Microkernel OS Integrated Message Passing and Virtual Memory  Send = memory remap (cheap!) Threads may… Allocate, de-allocate virtual memory Share address spaces Copy address spaces Pagein and pageout

Implementation Address Map (PageTable)  Ordered, linked list or refs to Memory Objects (E.g. files) + Only entries for used addresses - More searching Pagefault handling  User level Pager Services Message Passing between Kernel and Pager Address Map (Page Table) Memory Object List Main Memory

Evaluation Ported to  VAX, IBM RT PC, SUN3, …  UnixPT, InvertedPT, PT/Segment Clean separation  HW dependent and HW independent TLB not required  But may be used by Mach Performance  Comparison UNIX - Mach on different architectures  Mach equal or better Conclusion  Clean separation is possible and has no cost!

Labels and Event Processes Isolation and Protection in WebServices  Stateful services with many concurrent users  Isolation between users (not processes) Goals  Execute user requests in isolated address spaces  Restrict information flow Avoid leaking private user data User data only communicated to privileged system parts Principle of least privilege Application specific policies

Labels Basic Idea  Restrict access to communication primitives, send & recv A can talk to B, if B is equally privileged If B receives a message from A, this may restrict B’s ability to speak with others Labels define send & recv privileges relative to domains (compartments)  Kernel support operations + checking of privileges  Applications define information flow policies

Event Processes Execute user requests in isolated address spaces? Problem  Address spaces are associated with processes  Forking 1 process per user does not scale! One reason: Huge pagetables  Threads scale better, but provide no isolation Solution  Isolate data from multiple users within one address space  Event Process Abstraction Event handler executes in the context of a given user

Implementation Base Process  Address space divided between event processes  Event processes Context  Receive Ports  Communication privileges (Labels)  Private user data Bind to private ports Scheduled by kernel within private context  (On incoming message)

Evaluation Experiments on WebService  Memory consumption Extra 1.5 Page (4KB) per event process!  Cost of Isolation (Labels) Modest overheads on throughput, latency Throughput decrease as with increasing number of event processes  Database costs due to label storage growth Importance  Virtual address is to big  How do we implement small virtual address spaces for lightweigth processes?