Presentation of Extensibility, Safety and Performance in the SPIN Operating System Brain N. BershadStefan SavagePrzemyslaw Emin Gun Sirer Marc E.FiuczynskiDavid.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

CS533 Concepts of Operating Systems Class 14 Virtualization and Exokernels.
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.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, David Becker, Marc.
Background Computer System Architectures Computer System Software.
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
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,
G Robert Grimm New York University Opal.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Virtual Memory Virtual Memory Management in Mach Labels and Event Processes in Asbestos Ingar Arntzen.
Extensibility, Safety and Performance in the SPIN Operating System Bershad et al Presentation by norm Slides shamelessly “borrowed” from Stefan Savage’s.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
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,
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Active Messages: a Mechanism for Integrated Communication and Computation von Eicken et. al. Brian Kazian CS258 Spring 2008.
USER LEVEL INTERPROCESS COMMUNICATION FOR SHARED MEMORY MULTIPROCESSORS Presented by Elakkiya Pandian CS 533 OPERATING SYSTEMS – SPRING 2011 Brian N. Bershad.
Extensibility, Safety and Performance in the SPIN Operating System Dave Camarillo.
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
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.
1 Extensible Kernels Amar Phanishayee. 2 Traditional OS services – Management and Protection Provides a set of abstractions Processes, Threads, Virtual.
1 Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska and Henry M. Levy Presented by: Karthika Kothapally.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
CS510 Concurrent Systems Jonathan Walpole. Lightweight Remote Procedure Call (LRPC)
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?
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
SPIN: Design Contention between Safety-Extensibility-Performance Review of Extensibility, Safety and Performance in the SPIN Operating System By Lewis.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Operating System Architectures
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CS533 Concepts of Operating Systems Jonathan Walpole.
Operating System Architectures
Extensibility, Safety and Performance in the SPIN Operating System Ashwini Kulkarni Operating Systems Winter 2006.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
CS533 Concepts of Operating Systems Jonathan Walpole.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Processes Introduction to Operating Systems: Module 3.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Networking Implementations (part 1) CPS210 Spring 2006.
The Mach System Silberschatz et al Presented By Anjana Venkat.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
CS533 Concepts of Operating Systems Jonathan Walpole.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
The Structuring of Systems Using Upcalls By David D. Clark Presented by Samuel Moffatt.
CS533 Concepts of Operating Systems
Extensible OSes Exokernel and SPIN (Lecture 9, cs262a)
Presentation by Omar Abu-Azzah
Presented by Neha Agrawal
Outline Operating System Organization Operating System Examples
CSE 60641: Operating Systems
Advanced Operating Systems (CS 202) Operating System Structure
CSE 542: Operating Systems
Presentation transcript:

Presentation of Extensibility, Safety and Performance in the SPIN Operating System Brain N. BershadStefan SavagePrzemyslaw Emin Gun Sirer Marc E.FiuczynskiDavid Becker Craig Chambers Susan Eggers By Anandhi Sundaram

 SPIN under development at university of Washington Motivation OS has to support Multimedia, Distributed Memory management, hence systems are structured to support application specific extensions. Goals  Extensibility : allow for extensions to dynamically specialize OS services by providing fine-grain access to system services through interfaces  Safety : isolate critical kernel interfaces from malicious kernel extensions  Performance: provide low communication overhead between extension and kernel History & Goals CS533 - Concepts of Operating Systems

3 Three Way Tension  DOS: provides for extensibility at the cost of safety  Mach:  Provides extensibility at the cost of performance in the form of expensive IPC  Micro-kernel needs substantial changes to compensate for limitations in interfaces  L3 micro-kernel:  IPC is improved by protected procedure call implementation (as in LRPC) with overhead of nearly 100 procedure call times

CS533 - Concepts of Operating Systems 4 Different OS Structures

Techniques Followed to Achieve Goals  Performance: o Co-location - kernel and dynamically linked extension share same virtual address space o Enables communication between system and extension code to be cost of procedure call  Safety: o Language support - restrictions are enforced using the type-safe properties of Modula-3, the programming language in which SPIN and its extensions are written o Dynamic linking - extensions exist within logical protection domains. In-kernel dynamic linker enables cross-domain communication at overhead of procedure call  Extensibility: o Provide fine-grain interfaces to core system services. o Dynamic call binding – provide relationship between system components and extensions at runtime CS533 - Concepts of Operating Systems 5

6

7

8 Implementing Safety  Previous Approaches:  Hardware Protection through Address Spaces, Coarse-grained and expensive  Software-based Fault Isolation (“Efficient Software-based Fault Isolation” paper)  SPIN relies on Language-level Support  Modula-3 Properties  Type Safety  Automatic Storage Management  Support for Interfaces

CS533 - Concepts of Operating Systems 9 Safety : Language Support Type safety  Prevents access to memory arbitrarily, compile-time check enforces pointer may reference only to objects of its referent’s type  Array bound violation checks enforced by combination of compile-time, run-time checks  Automatic storage management

CS533 - Concepts of Operating Systems 10 Safety : Language Support Interfaces Hide Resources  Modula-3 Modules are composed of Interface (public part), implementation or module (private part)  Interface: Gives only the types and procedure Interfaces  Module: Procedure definitions and private declaration hidden from clients INTERFACE ; {Imports} {Declarations} END. MODULE [ EXPORTS { ","... } ]; {Imports} {Declarations} BEGIN (* Optional Module startup code; BEGIN required *) END.

Safety : Interfaces INTERFACE Console; TYPE T <: REFANY (* T is a pointer and only Console.T is visible *) CONST InterfaceName = “ConsoleService” (* A Global Name *) PROCEDURE open() :T; (* open returns a capability for the console *) PROCEDURE write(t :T;msg: TEXT); PROCEDURE Read(t: VAR, msg:TEXT); PROCEDURE Close(t :T); END Console; MODULE Gatekeeper; (* A client *) IMPORT Console; VAR c: Console.T; (* A capability for *) (* the console device *) PROCEDURE IntruderAlert() = BEGIN c := Console.Open(); Console.Write(c, "Intruder Alert"); Console.Close(c); END IntruderAlert; BEGIN END Gatekeeper; ; MODULE Console; (* An implementation module. *) (* The implementation of Console.T *) TYPE Buf = ARRAY [0..31] OF CHAR; REVEAL T = BRANDED REF RECORD (* T is a pointer *) inputQ: Buf; (* to a record *) outputQ: Buf; (* device specific info *) END; (* Implementations of interface functions *) (* have direct access to the revealed type. *) PROCEDURE Open():T =... END Console CS533 - Concepts of Operating Systems 11

CS533 - Concepts of Operating Systems 12 Capabilities  Capabilities are like ‘key’ provided to Extensions to access resources through Interface provided by Kernel.  Capabilities are implemented using Pointers declared within Interface, Supported by Modula-3 language.  A Pointer can be passed from the kernel to a user- level application as an externalized reference.  An Externalized reference is an INDEX into a per- application table in the kernel, that contains type safe references to in-kernel data structures.

CS533 - Concepts of Operating Systems 13 Protection Domains  Logical protection domains within a single address space  In terms of dynamic linking, all domains are created at runtime, by operating on accessible interfaces, or by manipulating existing domains  Create, CreatefromModule,resolve, combine.  SpinPublic, SpinPrivate  A module that exports an interface explicitly creates a domain for its interface, and exports the domain through an in-kernel Nameserver

Combined Domains SpinPublic, SpinPrivate

CS533 - Concepts of Operating Systems 15

CS533 - Concepts of Operating Systems 16 Extensibility  SPIN uses Events and Handlers to integrate Extensions with the kernel  Event is procedure exported from an interface  Handler is procedure of same type as event  Extensions explicitly register handlers with Events through a Central dispatcher  Central dispatcher routes events to handlers  In case of multiple handlers, one final result is passed back to the event raiser

17 CS533 - Concepts of Operating Systems  Handler restrictions enforced by the primary module – implementation module that statically exports the event – other modules interact with the primary module can deny/accept the handler can associate guards for executing the handler  Dispatcher Scalability

CS533 - Concepts of Operating Systems 18 Core Services – Memory Management  Three basic fine-grain services provided by SPIN o Physical address service : controls the use and allocation of physical pages. o Virtual address service o Translation service o Can be used by extensions/ applications to define services like demand-paging, copy-on-write, distributed shared memory, concurrent garbage collection o Implementation: extension that implements UNIX address space semantics for applications.

CS533 - Concepts of Operating Systems 19 Core Services – Thread Management  User-level threads require knowledge of kernel events  Scheduler Activations have high communication overhead due to kernel crossings  SPIN: An application can provide its own thread package and scheduler that executes within the kernel

CS533 - Concepts of Operating Systems 20 Core Services - Thread Management SPIN defines structure for Implementation of thread model  Strands similar to user-level threads, have no kernel context  Scheduler multiplexes resources among Strands  An Application Specific thread package defines an implementation of the strand Interface for its own threads  The Interface : Two events Block, Unblock – raised by kernel to signal changes in strand’s execution state to application-specific Scheduler. Allows implementation of new scheduling policies  Scheduler communicates with Thread Package using Checkpoint and Resume

CS533 - Concepts of Operating Systems 21 Core Services - Thread Management  The responsibility for scheduling and synchronization within the kernel belongs to the kernel for safety reasons  Global scheduler implements a round-robin, preemptive, priority policy  Some Implementations using Strand Interface: o DEC OSF/1 kernel threads o C-Threads o Modula-3 Threads  SPIN’s core services are trusted services – The interfaces are designed to ensure that, an extension’s failure to use an interface correctly is isolated to the extension itself

CS533 - Concepts of Operating Systems 22 System Performance  Microbenchmarks to reveal overhead of basic system functions, such as protected procedure call, thread management, and virtual memory were run on DEC OSF/1, Mach and SPIN  Overhead of in-kernel protected communication can be order of procedure call in SPIN  Inference: SPIN allows use of traditional communication mechanisms having comparable performance to other systems  SPIN’s extensible thread implementation does not incur a performance penalty when compared to non- extensible systems, even when integrated with kernel services.

CS533 - Concepts of Operating Systems 23 Applications using SPIN  Implementation of Network Protocol Stacks for Ethernet and ATM networks using SPIN’s extension architecture  Networked Video System consisting of Server and Client Viewer exploits SPIN’s extension architecture  End-to-End application performance can benefit from SPIN’s architecture Conclusion : It is possible to combine extensibility, safety and performance in a single system

CS533 - Concepts of Operating Systems 24 References   Extensibility, Safety and Performance in the SPIN Operating System, Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, David Becker, Marc Fiuczynski, Craig Chambers, Susan Eggers, in "Proceedings of the 15th ACM Symposium on Operating System Principles (SOSP-15)", Copper Mountain, CO. pp A design, implementation and performance paper. Abstract, Paper (postscript), Slides (postscript). Brian BershadStefan SavagePrzemyslaw PardyakEmin Gun SirerDavid BeckerMarc FiuczynskiCraig ChambersSusan Eggers AbstractPaper (postscript)Slides (postscript)  Language Support for Extensible Operating Systems, Wilson Hsieh, Marc Fiuczynski, Charles Garrett, Stefan Savage, David Becker, Brian Bershad, Appeared in the Workshop on Compiler Support for System Software, February We've been pretty happy with M3, but we've had to deal with a few shortcomings in order to use the language in a safe extensible operating system. This paper describes how we've addressed those shortcomings. Abstract, Paper (postscript), Slides (postscript). Wilson HsiehMarc FiuczynskiStefan SavageDavid Becker Brian Bershad AbstractPaper (postscript)Slides (postscript)

CS533 - Concepts of Operating Systems 25 References  Safe Dynamic Linking in an Extensible Operating System, Emin Gun Sirer, Marc Fiuczynski, Przemyslaw Pardyak, Brian Bershad, Appeared in the Workshop on Compiler Support for System Software, February Describes the dynamic linker we use to load code into the kernel. Key point is the ability to create and manage linkable namespaces that describe interfaces and collections of interfaces. Paper (postscript), Slides (postscript). Emin Gun SirerMarc FiuczynskiPrzemyslaw PardyakBrian Bershad Paper (postscript)Slides (postscript) 