ESP: A Language for Programmable Devices Sanjeev Kumar, Yitzhak Mandelbaum, Xiang Yu, Kai Li Princeton University.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

A DISTRIBUTED CSMA ALGORITHM FOR THROUGHPUT AND UTILITY MAXIMIZATION IN WIRELESS NETWORKS.
Multiple Processor Systems
Multiple Processor Systems
Reliable and Efficient Programming Abstractions for Sensor Networks Nupur Kothari, Ramki Gummadi (USC), Todd Millstein (UCLA) and Ramesh Govindan (USC)
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Sensor Network Platforms and Tools
Assembly Code Verification Using Model Checking Hao XIAO Singapore University of Technology and Design.
1 Concurrency Specification. 2 Outline 4 Issues in concurrent systems 4 Programming language support for concurrency 4 Concurrency analysis - A specification.
Fast Communication Firefly RPC Lightweight RPC  CS 614  Tuesday March 13, 2001  Jeff Hoy.
Multiple Processor Systems
Fast Paths in Concurrent Programs Wen Xu, Princeton University Sanjeev Kumar, Intel Labs. Kai Li, Princeton University.
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,
DISTRIBUTED AND HIGH-PERFORMANCE COMPUTING CHAPTER 7: SHARED MEMORY PARALLEL PROGRAMMING.
Vertically Integrated Analysis and Transformation for Embedded Software John Regehr University of Utah.
490dp Synchronous vs. Asynchronous Invocation Robert Grimm.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
Active Messages: a Mechanism for Integrated Communication and Computation von Eicken et. al. Brian Kazian CS258 Spring 2008.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Utah Verifier Group Research Overview Robert Palmer.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Advances in Language Design
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
A Simple Method for Extracting Models from Protocol Code David Lie, Andy Chou, Dawson Engler and David Dill Computer Systems Laboratory Stanford University.
Using Model-Checking to Debug Device Firmware Sanjeev Kumar Microprocessor Research Labs, Intel Kai Li Princeton University.
Distributed Shared Memory: A Survey of Issues and Algorithms B,. Nitzberg and V. Lo University of Oregon.
1b.1 Types of Parallel Computers Two principal approaches: Shared memory multiprocessor Distributed memory multicomputer ITCS 4/5145 Parallel Programming,
CS533 Concepts of Operating Systems Jonathan Walpole.
Cluster Computers. Introduction Cluster computing –Standard PCs or workstations connected by a fast network –Good price/performance ratio –Exploit existing.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Concurrent Aggregates (CA) Andrew A. Chien and William J. Dally Presented by: John Lynn and Ryan Wu.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
The Cosmic Cube Charles L. Seitz Presented By: Jason D. Robey 2 APR 03.
CIS 842: Specification and Verification of Reactive Systems Lecture 1: Course Overview Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The.
Cache Coherence Protocols 1 Cache Coherence Protocols in Shared Memory Multiprocessors Mehmet Şenvar.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Ronny Krashinsky Erik Machnicki Software Cache Coherent Shared Memory under Split-C.
ESP: A Language for Programmable Devices Sanjeev Kumar Princeton University Advisor : Kai Li.
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
On Implementing High Level Concurrency in Java G Stewart von Itzstein Mark Jasiunas University of South Australia.
3/12/2013Computer Engg, IIT(BHU)1 PARALLEL COMPUTERS- 2.
CS533 Concepts of Operating Systems Jonathan Walpole.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Specifying Multithreaded Java semantics for Program Verification Abhik Roychoudhury National University of Singapore (Joint work with Tulika Mitra)
Gauss Students’ Views on Multicore Processors Group members: Yu Yang (presenter), Xiaofang Chen, Subodh Sharma, Sarvani Vakkalanka, Anh Vo, Michael DeLisi,
Cluster Computers. Introduction Cluster computing –Standard PCs or workstations connected by a fast network –Good price/performance ratio –Exploit existing.
Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.
An Efficient Compilation Framework for Languages Based on a Concurrent Process Calculus Yoshihiro Oyama Kenjiro Taura Akinori Yonezawa Yonezawa Laboratory.
Introduction to Operating Systems Concepts
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software Anastasia Mironova.
Alternative system models
Chapter 4: Threads.
Reachability testing for concurrent programs
Outline Chapter 2 (cont) OS Design OS structure
Chapter 4: Threads & Concurrency
Operating System Overview
Presentation transcript:

ESP: A Language for Programmable Devices Sanjeev Kumar, Yitzhak Mandelbaum, Xiang Yu, Kai Li Princeton University

Sanjeev KumarESP: A Language for Programmable Devices2 Programmable Devices Network Card Bus CPU D Mem R Disk CPU D D D Mem R Main CPUMain Memory Move functionality from main CPUs to devices

Sanjeev KumarESP: A Language for Programmable Devices3 Programming Devices in C WaitReq WaitNet WaitDMA Low-overhead concurrency –Threads vs. Event-Driven State Machines A state machine event DmaFree execute event UserReq execute processUser() event KernelReq execute processKernel() event NetFree execute

Sanjeev KumarESP: A Language for Programmable Devices4 Programming devices in C Contd. Programming is hard –Sequential code split into handlers Difficult for C Compiler to Optimize –Explicitly save values in global variables Hand optimizations make it worse –Fast paths (Violate modularity) –Ad-hoc Scheduling

Sanjeev KumarESP: A Language for Programmable Devices5 Case Study: VMMC Firmware Used Myrinet network cards –Gigabit network, 33 MHz CPU, 1 MB Event-Driven State Machines in C –Hard to program VMMC: 15,600 lines of C code –Hard to debug Complicated race conditions Trusted by the OS –Achieves good performance Requires hand optimizations Data OS VMMC Firmware Application Network High-Performance Communication Network Card

Sanjeev KumarESP: A Language for Programmable Devices6 Outline Motivation ESP overview ESP language Verifying ESP programs Performance of ESP programs Conclusions

Sanjeev KumarESP: A Language for Programmable Devices7 ESP: Event-driven State-machines Programming Domain-specific language Goals –Easy to program Concise, modular programs –Allow extensive testing Existing software verification tools –Performance Low overhead Case Study: VMMC firmware

Sanjeev KumarESP: A Language for Programmable Devices8 ESP Approach pgm.spinpgm.C ESP Compiler pgm.ESP help.C Generate Firmware Develop and Test test.spin

Sanjeev KumarESP: A Language for Programmable Devices9 Outline Motivation ESP overview ESP language Verifying ESP programs Performance of ESP programs Conclusions

Sanjeev KumarESP: A Language for Programmable Devices10 The ESP Language Message passing style concurrency (like CSP) Processes & Synchronous channels –in : Receive a message on a channel –out : Send a message on a channel –alt : Wait on multiple in/out operations Processes communicate only using channels –No shared mutable data structure Static Design

Sanjeev KumarESP: A Language for Programmable Devices11 A Process encodes a State Machine channel chan1: int channel chan2: int process add5 { $v: int = 0; while( true) { in( chan1, v); out( chan2, v+5); } States are implicit Events are messages on channels Easy to read & optimize Initial waitChan2 waitChan1

Sanjeev KumarESP: A Language for Programmable Devices12 Memory Management ESP supports explicit management Explicit management is difficult –Global property of program ESP makes this a local property –Objects are not shared by processes –Objects sent over channels are “copied” Use verifiers to check correctness Safety through verification instead of GC

Sanjeev KumarESP: A Language for Programmable Devices13 Other Language Features Pattern Matching supports dispatch –Receivers specify patterns to match –Sender simply sends on a channel Channels support external interface –Some channels have external reader or writer –Unified mechanism (C and SPIN) –Use in/out to block on external events

Sanjeev KumarESP: A Language for Programmable Devices14 Case Study: VMMC Firmware Implemented VMMC using ESP –7 processes, 17 channels –500 lines ESP lines C code Modular programs that are easy to maintain Order of magnitude less code

Sanjeev KumarESP: A Language for Programmable Devices15 Outline Motivation ESP overview ESP language Verifying ESP programs Performance of ESP programs Conclusions

Sanjeev KumarESP: A Language for Programmable Devices16 Using Model Checking Verifiers State-space exploration –Try all possible scheduling options Automatic & produces counter example Exponential: State-space explosion ESP currently uses SPIN model checker –Designed for Software Systems –Assertions, Deadlocks, Linear Temporal Logic –Supports varying levels of coverage

Sanjeev KumarESP: A Language for Programmable Devices17 Case Study: VMMC Firmware Develop and debug retransmission protocol –Easier to debug than on the network card –Took 2 days (10 days in earlier implementation) Check for memory safety and leaks –Each process separately –Largest process: Less than a second –Used to find bugs Find deadlocks: Need abstract models

Sanjeev KumarESP: A Language for Programmable Devices18 Outline Motivation ESP overview ESP language Verifying ESP programs Performance of ESP programs Conclusions

Sanjeev KumarESP: A Language for Programmable Devices19 ESP Code Generation Compiling state machines –Combine them [Berry et. Al, Proebsting et. al.] –Low-overhead process management C as backend –Generates one large C function –Links with external C functions ESP Compiler performs optimizations –Whole program analysis

Sanjeev KumarESP: A Language for Programmable Devices20 Case Study: VMMC Firmware Measure overhead of using ESP –Microbenchmarks –Applications Compare performance –Earlier Implementation (vmmcOrig) –Earlier Implementation without Fast Paths (vmmcOrigNoFastPaths) –New Implementation using ESP (vmmcESP)

Sanjeev KumarESP: A Language for Programmable Devices21 Microbenchmarks Message Size (in Bytes) ss M B / s Message Size (in Bytes) LatencyBandwidth

Sanjeev KumarESP: A Language for Programmable Devices22 Applications SPLASH2 Applications on a 16 (4 X 4) node cluster 7% Slower on average Speedup

Sanjeev KumarESP: A Language for Programmable Devices23 Outline Motivation ESP overview ESP language Verifying ESP programs Performance of ESP programs Conclusions

Sanjeev KumarESP: A Language for Programmable Devices24 Related Work Code Generation & Verification –Esterel, Teapot, Promela++ Concurrent Languages –Theory: CSP, Squeak –Practice: Java, OCCAM, CML Tools – Meta-level compilation, SLAM, Verisoft

Sanjeev KumarESP: A Language for Programmable Devices25 Conclusions ESP: Domain-specific language –Support for writing concise, modular programs Order of magnitude less code –Developing and Extensive testing with SPIN Including checking memory safety –Low performance overhead

Sanjeev KumarESP: A Language for Programmable Devices26 - The End -

Sanjeev KumarESP: A Language for Programmable Devices27 Esterel Synchronous programming language –Encode control of reactive systems Generate software or hardware Deterministic reaction But –Only encodes control flow –Constraints on the language –Harder to compile efficiently

Sanjeev KumarESP: A Language for Programmable Devices28 Teapot Domain-specific language –Implement coherence protocols Specify a state machine Use continuations to simplify programming But –Only encodes control flow –Uses handlers: Code fragmentation –Similar approach would be less modular

Sanjeev KumarESP: A Language for Programmable Devices29 Promela++ Language for Layered Network Protocol –Non-strict extension of promela Asynchronous communication But –Layered structure –Asynchronous: overhead, ordering –No support for memory management

Sanjeev KumarESP: A Language for Programmable Devices30 Fast Paths Challenges –Scheduling choices made in the fast paths Also avoid starvation –Effective fast paths –How to let programmers specify fast paths ? User annotations Expose details to implement it in C