extensibility, safety and performance in the spin operating system department of computer science...

20
Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski, David Becker, Craig Chambers, Susan Eggers Presented By James Whiteneck

Upload: lenard-king

Post on 18-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Extensibility, Safety and Performance in the SPIN Operating System

Department of Computer Science and Engineering, University of WashingtonBrian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski, David Becker, Craig Chambers, Susan Eggers

Presented By James Whiteneck

Page 2: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

OutlineOverviewRelated WorkMotivationGoalsSPIN

◦Architecture (Domains and Extensions)◦Core Services (Memory and Thread

Management)◦Performance

Conclusion

Page 3: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

OverviewSPIN is an extensible OS that

allows applications to alter the OS

Executed in kernels virtual address space

Extensions are written in a type safe language

Dynamically linked into existing OS kernel

Provides ability to alter core services

Page 4: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Related WorkHydra

◦Allows applications to manage resources through kernel (high overhead)

Microkernels◦Extendible (high overhead)

RPCs◦L3 (high overhead, 100x as much as PC)

Software-Based Fault Isolation◦Not application specific

Page 5: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

MotivationOperating Systems are complex

◦Not easy to changeWant: System that can be

dynamically changed to suit specific applications◦Safe, easy to use, good performance

Image taken from Language Support for Extensible Operating Systems talk. Link: http://www-spin.cs.washington.edu/papers/talks/wcs96.ps

Page 6: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Operating System Structures

User Level

Kernel

Hardware

Monolithic

User Level

Microkernel

Hardware

Microkernel

OS

Extensible

User Level

Kernel

Hardware

OS

Page 7: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN

Image taken from Language Support for Extensible Operating Systems talk. Link: http://www-spin.cs.washington.edu/papers/talks/wcs96.ps

Page 8: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

GoalsCo-location: extensions are linked directly

into kernel◦Reduces cost of sharing data

Enforced modularity: Compiler enforced boundaries

Protection domains: kernel interfaces◦ Isolate failures and provide cheap context

switches◦Safely exposing kernel interfaces

Dynamic Call Binding:◦Events trigger extensions

Page faults, threads

Page 9: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN - ArchitectureSoftware to safely combine

system and application codeImplemented in Modula-3

◦SafetyDefined in two models

◦Protections Controls access to resources through

capabilities

◦Extensions Defined in terms of events and handlers

Page 10: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Protection DomainsCapabilities: is a reference

(pointer) to a system object, interface, or collection of interfaces◦Protection provided by compiler◦Can’t be changed

Protection is at the language level, not in virtual memory

Page 11: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

ExtensionsExtension model provides controlled

communication between extensions (events and event handlers) and system

Event◦Message that announces a change in system

state or requests a serviceEvent handler

◦Procedure that receives messages from events

Events sent through central dispatcher

Page 12: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN – Core ServicesMemory Management

◦Three service interfaces Physical Address

Physical page allocation and use Virtual Address

Capability allocation Translation

Mappings between physical and virtual addresses

Page 13: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN – Core ServicesThread Management

◦Strands Similar to threads No state in kernel

◦Set of events and event handlers◦Interfaces provide scheduling,

concurrency, synchronization Application specific

Page 14: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN – Core ServicesTrust

◦SPIN trusts core services Required to mediate access to resources,

applications, and extensions

◦Extension failures only affect their own extension

Page 15: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

SPIN - PerformanceOS Model Comparisons

◦SPIN v0.4◦DEC OSF/1 v2.1 (monolithic)◦MACH v3.0 (microkernel)

Compared◦System Size◦Microbenchmarks◦Networking◦End-to-end Performance

Page 16: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Performance - Microbenchmarks

Operation DEC OSF/1 Mach SPINProtected in-kernel call n/a n/a 0.13System call 5 7 4Cross-address space call 845 104 89

Prot

ecte

d in

-ker

nel c

all

Syst

em cal

l

Cross

-add

ress

spa

ce cal

l0

20406080

100120

Protected Communication

DEC OSF/1MachSPIN

Operation

Mic

rose

con

ds

845, way off the page

Page 17: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Performance - Microbenchmarks

Operation DEC OSF/1 Mach SPIN kernel user kernel user kernel layered integratedFork-Join 198 1230 101 338 22 262 111Ping-Pong 21 264 71 115 17 159 85

kernel user kernel user kernel layered integratedDEC OSF/1 Mach SPIN

0

50

100

150

200

250

300

350

400

Thread Management

Fork-JoinPing-Pong

OS - Operation

Mic

rose

con

ds

1230, also way off the page

Page 18: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Performance - Microbenchmarks

Dirty Fault Trap Prot1 Prot100 Unprot100 Appel1 Appel20

200

400

600

800

1000

1200

1400

1600

1800

2000

0

329260

45

1041 1016

382 351

0

415

185106

1792

302

819

608

2 29 7 16

213 214

39 29

Virtual Memory

DEC OSF/1MachSPIN

Operation

Mic

rose

con

ds

Page 19: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

Other TestsNetworking

◦Measured round trip latency and bandwidth

◦SPIN application code executes at kernel level Low latency access to both device and

data

End-to-end◦Measured number of clients serviced

by a networked video server SPIN allowed same number of clients for

less CPU

Page 20: Extensibility, Safety and Performance in the SPIN Operating System Department of Computer Science and Engineering, University of Washington Brian N. Bershad,

ConclusionAn extensible OS can achieve

good performance without compromising safety

Able to provide a customizable system using a base set of core services to build upon

Future OS should take advantage of compiler safety and support for programming languages.