Advanced Operating Systems (CS 202) Extensible Operating Systems (II) Jan, 13, 2016.

Slides:



Advertisements
Similar presentations
Northwestern University 2007 Winter – EECS 443 Advanced Operating Systems Exokernel: An Operating System Architecture for Application-Level Resource Management.
Advertisements

MICRO-KERNELS New Generation Innovation. The contents Traditional OS view & its problems. Micro-kernel : introduction to concept. First generation micro-kernels.
EECS 470 Virtual Memory Lecture 15. Why Use Virtual Memory? Decouples size of physical memory from programmer visible virtual memory Provides a convenient.
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
May 7, A Real Problem  What if you wanted to run a program that needs more memory than you have?
1 A Real Problem  What if you wanted to run a program that needs more memory than you have?
Exokernel: An Opertion System Architecture for Application-Level Resource Management SIGCOMM ’ 96, PDOS-MIT Presented by Ahn Seunghoon Dawson R. Engler,
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,
Extensible Kernels Edgar Velázquez-Armendáriz September 24 th 2009.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr.
Dawson R. Engler, M. Frans Kaashoek, and James O'Tool Jr.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
OS Spring’03 Introduction Operating Systems Spring 2003.
Translation Buffers (TLB’s)
Microkernels: Mach and L4
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
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.
Early OS security Overview by: Greg Morrisett Cornell University, Edited (by permission) for CSUS CSc250 by Bill Mitchell.
Dawson Engler, Frans Kaashoek, James O’Toole
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T.
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy (Part II)
Extensible Kernels Mingsheng Hong. OS Kernel Types Monolithic Kernels Microkernels – Flexible (?) – Module Design – Reliable – Secure Extensible Kernels.
CS533 Concepts of OS Class 16 ExoKernel by Constantia Tryman.
Protection and the Kernel: Mode, Space, and Context.
Operating System Architectures
APPLICATION PERFORMANCE AND FLEXIBILITY ON EXOKERNEL SYSTEMS M. F. Kaashoek, D. R. Engler, G. R. Ganger H. M. Briceño, R. Hunt, D. Mazières, T. Pinckney,
Paper by Engler, Kaashoek, O’Toole Presentation by Charles Haiber.
CS533 Concepts of Operating Systems Jonathan Walpole.
Extensibility, Safety and Performance in the SPIN Operating System Ashwini Kulkarni Operating Systems Winter 2006.
1 Micro-kernel. 2 Key points Microkernel provides minimal abstractions –Address space, threads, IPC Abstractions –… are machine independent –But implementation.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
CS 153 Design of Operating Systems Spring 2015 Lecture 17: Paging.
Operating Systems ECE344 Ding Yuan Paging Lecture 8: Paging.
Exokernel: An Operating System Architecture for Application-Level Resource Management" by Dawson R. Engler, M. Frans Kaashoek, and James O'Toole Jr. Chris.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day14:
MIT’s Exokernel Presented by Victoria Barrow Kyle Safford Sean Sommers.
A summary by Nick Rayner for PSU CS533, Spring 2006
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
1 Some Real Problem  What if a program needs more memory than the machine has? —even if individual programs fit in memory, how can we run multiple programs?
Virtual Memory.  Next in memory hierarchy  Motivations:  to remove programming burdens of a small, limited amount of main memory  to allow efficient.
Advanced Operating Systems (CS 202) Extensible Operating Systems Jan, 11, 2016.
CS533 Concepts of Operating Systems Jonathan Walpole.
Exokernel: An Operating System Architecture for Application-Level Resource Management By Dawson R. Engler, M. Frans Kaashoek, James O’Toole Jr. Presented.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
Exokernel: An Operating System Architecture for Application-Level Resource Management by Dawson R. Engler, M. Frans Kaashoek, and James O'Toole Jr. Presented.
CMSC 611: Advanced Computer Architecture
CS161 – Design and Architecture of Computer
A Real Problem What if you wanted to run a program that needs more memory than you have? September 11, 2018.
CS703 - Advanced Operating Systems
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Virtual Memory Overcoming main memory size limitation
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
EXOKERNEL Gabriel Beltran John Blackman David Martin Kurt Rohrbacher
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Paging and Segmentation
Operating Systems Structure
Cache writes and examples
Advanced Operating Systems (CS 202) Scheduling (1)
Review What are the advantages/disadvantages of pages versus segments?
Advanced Operating Systems (CS 202) Operating System Structure
Presentation transcript:

Advanced Operating Systems (CS 202) Extensible Operating Systems (II) Jan, 13, 2016

Motivation for Exokernels Traditional centralized resource management cannot be specialized, extended or replaced Privileged software must be used by all applications Fixed high level abstractions too costly for good efficiency Exo-kernel as an end-to-end argument

Exokernel Philosophy Expose hardware primitives to libraryOS – Not even mechanisms are implemented by exo-kernel They argue that mechanism is policy Exo-kernel worried only about protection not resource management

Design Principles Track resource ownership Ensure protection by guarding resource usage Revoke access to resources Expose hardware, allocation, names and revocation Basically validate binding, then let library manage the resource

Exokernel Architecture

Separating Security from Management Secure bindings – securely bind machine resources Visible revocation – allow libOSes to participate in resource revocation Abort protocol – break bindings of uncooperative libOSes

Secure Bindings Decouple authorization from use Authorization performed at bind time Protection checks are simple operations performed by the kernel Allows protection without understanding Operationally – set of primitives needed for applications to express protection checks

Example resource TLB Entry – Virtual to physical mapping done by library – Binding presented to exo-kernel – Exokernel puts it in hardware TLB – Process in library OS then uses it without exo- kernel intervention 8

Implementing Secure Bindings Hardware mechanisms: TLB entry, Packet Filters Software caching: Software TLB stores Downloaded Code: invoked on every resource access or event to determine ownership and kernel actions

Downloaded Code Example: (DPF) Downloaded Packet Filter Eliminates kernel crossings Can execute when application is not scheduled Written in a type safe language and compiled at runtime for security Uses Application-specific Safe Handlers which can initiate a message to reduce round trip latency

Visible Resource Revocation Traditionally resources revoked invisibly Allows libOSes to guide de-allocation and have knowledge of available resources – ie: can choose own ‘victim page’ Places workload on the libOS to organize resource lists

Abort Protocol Forced resource revocation Uses ‘repossession vector’ Raises a repossession exception Possible relocation depending on state of resource

Managing core services Virtual memory: – Page fault generates an upcall to the library OS via a registered handler – LibOS handles the allocation, then presents a mapping to be installed into the TLB providing a capability – Exo-kernel installs the mapping – Software TLBs 13

Managing CPU A time vector that gets allocated to the different library operating systems – Allows allocation of CPU time to fit the application Revokes the CPU from the OS using an upcall – The libOS is expected to save what it needs and give up the CPU – If not, things escalate – Can install revocation handler in exo-kernel 14

Putting it all together Lets consider an exo-kernel with downloaded code into the exo-kernel When normal processing occurs, Exo- kernel is a sleeping beauty When a discontinuity occurs (traps, faults, external interrupts), exokernel fields them – Passes them to the right OS (requires book-keeping) – compare to SPIN? – Application specific handlers 15

Evaluation Again, a full implementation How to make sense from the quantitative results? – Absolute numbers are typically meaningless given that we are part of a bigger system Trends are what matter Emphasis is on space and time – Key takeaway  significantly better than even monolithic kernel 16

Questions and conclusions Downloaded code – security? – Some mention of SFI and little languages – SPIN is better here SPIN vs. Exokernel – Spin—extend mechanisms; some abstractions still exist – Exo-kernel: securely expose low-level primitives (primitive vs. mechanism?) Microkernel vs. exo-kernel – Much lower interfaces exported – Argue they lead to better performance – Of course, less border crossing due to downloadable code 17

How have such designs influenced current OS? Kernel modules Virtualization Containers Specialized OS 18

ON MICROKERNEL CONSTRUCTION 19

L4 microkernel family Successful OS with different offshoot distributions – Commercially successful OKLabs OKL4 shipped over 1.5 billion installations by 2012 –Mostly qualcomm wireless modems –But also player in automative and airborne entertainment systems Used in the secure enclave processor on Apple’s A7 chips –All iOS devices have it! 100s of millions 20

Big picture overview Conventional wisdom at the time was: – Microkernels offer nice abstractions and should be flexible – …but are inherently low performance due to high cost of border crossings and IPC – …because they are inefficient they are inflexible This paper refutes the performance argument – Main takeaway: its an implementation issue Identifies reasons for low performance and shows by construction that they are not inherent to microkernels –10-20x improvement in performance over Mach Several insights on how microkernels should (and shouldn’t) be built – E.g., Microkernels should not be portable 21

Paper argues for the following Only put in anything that if moved out prohibits functionality Assumes: – We require security/protection – We require a page-based VM – Subsystems should be isolated from one another – Two subsystems should be able to communicate without involving a third 22

Abstractions provided by L3 Address spaces (to support protection/separation) – Grant, Map, Flush – Handling I/O Threads and IPC – Threads: represent the address space – End point for IPC (messages) – Interrupts are IPC messages from kernel Microkernel turns hardware interrupts to thread events Unique ids (to be able to identify address spaces, threads, IPC end points etc..) 23

Debunking performance issues What are the performance issues? 1. Switching overhead Kernel user switches Address space switches Threads switches and IPC 2. Memory locality loss TLB Caches 24

Mode switches System calls (mode switches) should not be expensive – Called context switches in the paper Show that 90% of system call time on Mach is “overhead” – What? Paper doesn’t really say Could be parameter checking, parameter passing, inefficiencies in saving state… – L3 does not have this overhead 25

Thread/address space switches If TLBs are not tagged, they must be flushed – Today? x86 introduced tags but they are not utilized If caches are physically indexed, no loss of locality – No need to flush caches when address space changes Customize switch code to HW Empirically demonstrate that IPC is fast 26

L2, L3, and main memory Review: End-to-end Core i7 Address Translation CPU VPNVPO 3612 TLBTTLBI L1 TLB (16 sets, 4 entries/set) VPN1VPN2 99 PTE CR3 PPNPPO 4012 Page tables TLB miss TLB hit Physical address (PA) Result 32/64... CTCO 406 CI 6 L2, L3, and main memory L1 d-cache (64 sets, 8 lines/set) L1 hit L1 miss Virtual address (VA) VPN3VPN4 99 PTE

Tricks to reduce the effect TLB flushes due to AS switch could be very expensive – Since microkernel increases AS switches, this is a problem – Tagged TLB? If you have them – Tricks with segments to provide isolation between small address spaces Remap them as segments within one address space Avoid TLB flushes 28

Memory effects Chen and Bershad showed memory behavior on microkernels worse than monolithic Paper shows this is all due to more cache misses Are they capacity or conflict misses? – Conflict: could be structure – Capacity: could be size of code Chen and Bershad also showed that self- interference more of a problem than user-kernel interference Ratio of conflict to capacity much lower in Mach –  too much code, most of it in Mach

Conclusion Its an implementation issue in Mach Its mostly due to Mach trying to be portable Microkernel should not be portable – It’s the hardware compatibility layer – Example: implementation decisions even between 486 and Pentium are different if you want high performance – Think of microkernel as microcode 30