1 Extensible Kernels Amar Phanishayee. 2 Traditional OS services – Management and Protection Provides a set of abstractions Processes, Threads, Virtual.

Slides:



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

Department of Computer Science and Engineering University of Washington Brian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM B. Bershad, S. Savage, P. Pardyak, E. G. Sirer, D. Becker, M. Fiuczynski, C. Chambers,
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.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
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 Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, David Becker, Marc.
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,
Extensible Kernels: Exokernel and SPIN Presented by Hakim Weatherspoon (Based on slides from Edgar Velázquez-Armendáriz and Ken Birman)
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 B. N. Bershad, S. Savage, P. Pardyak, E. G. Sirer, M. E. Fiuczyski, D. Becker, C. Chambers,
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.
Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr.
Extensibility, Safety and Performance in the SPIN Operating System Bershad et al Presentation by norm Slides shamelessly “borrowed” from Stefan Savage’s.
Dawson R. Engler, M. Frans Kaashoek, and James O'Tool Jr.
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,
1 Extensible Kernels Ken, with slides by Amar Phanishayee.
Extensibility, Safety and Performance in the SPIN Operating System Dave Camarillo.
Microkernels: Mach and L4
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 I/O Management in Representative Operating Systems.
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.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
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.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Exokernel: An Operating System Architecture for Application-Level Resource Management" by Dawson R. Engler, M. Frans Kaashoek, and James O'Toole Jr. Chris.
The Performance of Microkernel-Based Systems
MIT’s Exokernel Presented by Victoria Barrow Kyle Safford Sean Sommers.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
The Mach System Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne Presented by: Jee Vang.
Advanced Operating Systems (CS 202) Extensible Operating Systems Jan, 11, 2016.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
CS533 Concepts of Operating Systems Jonathan Walpole.
Advanced Operating Systems (CS 202) Extensible Operating Systems (II) Jan, 13, 2016.
Exokernel: An Operating System Architecture for Application-Level Resource Management By Dawson R. Engler, M. Frans Kaashoek, James O’Toole Jr. Presented.
Major OS Components CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Exokernel Operating System: An Introduction Liming Shu COSC 513, Summer 2002.
Exokernel: An Operating System Architecture for Application-Level Resource Management by Dawson R. Engler, M. Frans Kaashoek, and James O'Toole Jr. Presented.
Kernel Design & Implementation
Xen and the Art of Virtualization
The Mach System Sri Ramkrishna.
Extensible OSes Exokernel and SPIN (Lecture 9, cs262a)
Presentation by Omar Abu-Azzah
Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr [SOSP’97]
Modern Systems: Extensible KERNELS AND containers
Page Replacement.
Architectural Support for OS
Extensible OSes Exokernel and SPIN Lecture 19, cs262a
EXOKERNEL Gabriel Beltran John Blackman David Martin Kurt Rohrbacher
Outline Operating System Organization Operating System Examples
Operating Systems Structure
Modern systems: Extensible Kernels and Containers
Advanced Operating Systems (CS 202) Operating System Structure
Presentation transcript:

1 Extensible Kernels Amar Phanishayee

2 Traditional OS services – Management and Protection Provides a set of abstractions Processes, Threads, Virtual Memory, Files, IPC Sys calls and APIs (eg: Win32, POSIX) Resource Allocation and Management Accounting Protection and Security Concurrent execution

3 Problems (examples coming-up) Extensibility Abstractions overly general Apps cannot dictate management Implementations are fixed Performance Crossing over into the kernel is expensive Generalizations and hiding information affect performance Protection and Management offered with loss in Extensibility and Performance

4 Need for Application controlled management (examples) Buffer Pool Management In DBs (*) LRU, prefetch (locality Vs suggestion), flush (commit) Shared Virtual Memory (+) use a page fault to retrieve page from disk / another processor

5 Examples (cont.) Concurrent Checkpointing (+) Overlap checkpointing and program being checkpointed Change rights to R-only on dirty pages Copy each page and reset rights Allow reads; Use write faults to {copy, reset rights, restart} * OS Support for Database Management (Stonebraker) + Virtual Memory Primitives for User Programs (Andrew W. Appel and Kai Li)

6 Examples (cont.) [Implementation and Performance of Application-Controlled File Caching - Pei Cao, et al.] Feedback for file cache block replacement

7 Down with monarchy! French Revolution - Execution of Louis XVI

8 Challenges Extensibility Security Performance

9 Extensible Kernels Exokernel (SOSP 1995): safely exports machine resources Higher-level abstractions in Library OS Secure binding, Visible resource revocation, Abort Apps link with the LibOS of their choice SPIN (SOSP 1995): kernel extensions (imported) safely specialize OS services Extensions dynamically linked into OS kernel Safety ensured by Programming Language facilities

10 Exokernels - Motivation Existing Systems offer fixed high-level abstractions which is bad Hurt app performance (generalization – eg: LRU) Hide information (eg: page fault) Limit functionality (infrequent changes – cool ideas don’t make it through)

11 Motivation (cont.) Separate protection from management, mgmt in user space Apps should use domain specific knowledge to influence OS services Small and simple kernel – adaptable and maintainable

12 OS Component Layout Exokernel

13 Lib OS and the Exokernel Lib OS (untrusted) can implement traditional OS abstractions (compatibility) Efficient (Lib OS in user space) Apps link with Lib OS of their choice Kernel allows LibOS to manage resources, protects LibOss

14 Exokernel : Design Principles Securely expose hardware Min resource management as required by protection (allocation, revocation) Expose allocation No implicit allocation Expose Names Expose Revocation Eg: two-level replacement

15 Exokernel : Secure Bindings Lib OSs are untrusted Authorization at bind time Authentication at access time (no need to understand semantics – eg: FS permissions, groups) Techniques Hardware (TLB) Software (STLB – Kavita) download code (direct procedure call, sandboxing, type-safe language)

16 Secure Bindings Multiplexing Memory Record capabilities (ownership, bind time Check access time Capability passing to share resources Multiplexing the Network Application-specific Safe Handler (ASH) Download code into kernel (compiled to m/c runtime) No kernel crossing; Procedure call instead of scheduling (low RTT)

17 Resource Revocation Visible Revocation “please return a memory page” “return a page within 50 microseconds” CPU revocation at the end of time-slice Invisible better when revocations are frequent (due to f/b) Abort To revoke resources “by force” from misbehaving processes repossession vector, repossession exception Worst case repossession (guarantee)

18 ExOS + Aegis Platform – MIPS-based DECstation Aegis – exokernel ExOS – library OS Processes, Virtual Mem, IPC, Network Protocols (ARP/RARP, IP, UDP) Comparison with Ultrix (tuned monolithic kernel)

19 Base Cost in microSec 12.5 MHz ~11MIPS 16.6 MHz ~15MIPS 25 MHz ~25MIPS Demultiplexing SysCalls expensive in Ultrix. May have TLB miss in Sys call!

20 “barebone” unidirectional Protected Control Transfer (microSec) Types 1.Asynchronous (donate only current time slice to callee) 2.Synchronous L3 Entering kernel – 71 cycles Exiting Kernel – 36 cycles TLB flush on context switch

21 Key to Aegis’ Performance Easy keeping track of ownership Provides very little apart from low level multiplexing Caching secure bindings (STLB) Dynamic code generation

22 ExOS IPC Pipe – shared mem; yield Pipe’ has code inlining Shm – Yield to switch (ExOS), Signals (Ultrix) RPC – single function, no look-up. Cost of emulation in Ultrix using pipes or signals is high

23 ExOS Virtual Memory + Fast Sys call. - Half the time in look-up (vector). Repeated access to Aegis STLB and ExOS PageTable

24 ASH and scalability Ping-pong of counter in a 60-byte UDP packet 4096 times between 2 processes in user space on DECStation5000/125 Without ASH - response on being scheduled. Round Robin scheduling -> linear increase in RTT.

25 Exokernel: Summary Minimal Kernel Secure multiplexing of resources Bind time Authorization Portability OS Abstractions in user space (Lib OS) VM, IPC Apps link with OS of their choice

26 SPIN Use of language features for Extensions Extensibility Dynamic linking and binding of extensions Safety Interfaces. Type safety. Extensions verified by compiler Performance Extensions not interpreted; Run in kernel space

27 Language: Modula 3 Interfaces Type safety Array bounds checking Storage Management Threads Exceptions

28 Motivation From Stefan Savage’s SOSP 95 presentation Can we have all 3 in a single OS?

29 SPIN structure From Stefan Savage’s SOSP 95 presentation

30 Protection model Capabilities Pointer as capability Type safe (compile time check) Externalized reference

31 Protection model (cont.) Protection “domain” exported interfaces of safe object files Safe object file = verified by compiler or asserted by the kernel In-kernel name server Optional authorization for importing i/f

32 Events and Handlers Events message announcing Change in state Request for service Procedure exported from an interface Handlers register for events Multiple handlers

33 Dispatcher Central dispatcher – event router Primary handler Handler invocation Synchronous/Asynchronous Bounded time Ordered/Unordered

34 Handler Installation From Brian Bershad’s OSDI 96 presentation

35 Handler Installation (cont.) From Brian Bershad’s OSDI 96 presentation

36 From Stefan Savage’s SOSP 95 presentation Event Handling

37 Core Services: Memory Management Services Physical storage : allocate, deallocate, “reclaim” (returns capability) Naming (virtual) : allocate, deallocate Translation (mapping) : add/remove/check mapping Exceptions BadAddress PageNotPresent Extensions use these primitives to define an address space model

38 Core Services: Thread Management Strand interface block/unblock checkpoint/resume Global and application-specific schedulers fault-isolation Thread model can be defined using these primitives

39 Microbenchmarks IPC In-kernel Call Sockets, SUN RPC Mesgs. Thread Mgmt All numbers are in microseconds

40 Performance: Virtual Memory In-Kernel calls are more efficient than traps or messages All numbers are in microseconds

41 Performance: Networking Lower RTT because of in-kernel extension time in microseconds, Bandwidth in Mbps

42 End-to-End Performance Networked Video Server CPU utilization (network interface supports DMA)

43 Issues Dispatcher scalability Handler scheduling Garbage collection

44 Conclusion Extensibility without loss of security or performance Exokernels Safely export machine resources Decouple protection from management SPIN kernel extensions (imported) safely specialize OS services Safety ensured by Programming Language facilities