Page 1 Towards a Schedu Capturing OS Expertise in an Event Type System: the Bossa Experience Julia L. Lawall DIKU, University of Copenhagen Joint work.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
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.
Constructing Component-Based Extension Interfaces in Legacy Systems Code Gilles Muller École des Mines de Nantes Julia Lawall DIKU, University of Copenhagen.
Extensibility, Safety and Performance in the SPIN Operating System Brian Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, David Becker, Marc.
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
Chapter 5 Processes and Threads Copyright © 2008.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Extensibility, Safety and Performance in the SPIN Operating System Bershad et al Presentation by norm Slides shamelessly “borrowed” from Stefan Savage’s.
G Robert Grimm New York University Extensibility: SPIN and exokernels.
Chapter 13 Embedded Systems
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Exokernel: An Operating System Architecture for Application-Level Resource Management Dawson R. Engler, M. Frans Kaashoek, and James O’Toole Jr. M.I.T.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
November 18, 2004 Embedded System Design Flow Arkadeb Ghosal Alessandro Pinto Daniele Gasperini Alberto Sangiovanni-Vincentelli
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Scheduler Activations Jeff Chase. Threads in a Process Threads are useful at user-level – Parallelism, hide I/O latency, interactivity Option A (early.
What is Concurrent Programming? Maram Bani Younes.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Computer Organization Review and OS Introduction CS550 Operating Systems.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
CS533 Concepts of Operating Systems Jonathan Walpole.
1 Previous lecture review n Out of basic scheduling techniques none is a clear winner: u FCFS - simple but unfair u RR - more overhead than FCFS may not.
Page 1 On the Automatic Evolution of an OS Kernel using Temporal Logic and AOP Julia L. Lawall DIKU, University of Copenhagen Joint work with: Rickard.
Language Design for Implementing Process Scheduling Hierarchies Julia L. Lawall DIKU, University of Copenhagen Gilles Muller, Hervé Duchesne Ecole des.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Scheduling policies for real- time embedded systems.
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
What Every Developer Should Know about the Kernel Dr. Michael L. Collard 1.
Concurrency & Context Switching Process Control Block What's in it and why? How is it used? Who sees it? 5 State Process Model State Labels. Causes of.
CSCI1600: Embedded and Real Time Software Lecture 18: Real Time Languages Steven Reiss, Fall 2015.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
12/22/ Thread Model for Realizing Concurrency B. Ramamurthy.
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
CSC 322 Operating Systems Concepts Lecture - 7: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
CS333 Intro to Operating Systems Jonathan Walpole.
CS533 Concepts of Operating Systems Jonathan Walpole.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
Processes and threads.
Processes and Threads Processes and their scheduling
Day 12 Threads.
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Presentation by Omar Abu-Azzah
Other Important Synchronization Primitives
Threads CSSE 332 Operating Systems Rose-Hulman Institute of Technology
Threads & multithreading
Process management Information maintained by OS for process management
What is Concurrent Programming?
Lecture Topics: 11/1 General Operating System Concepts Processes
Lesson Objectives Aims Key Words
Thomas E. Anderson, Brian N. Bershad,
Chapter 13: I/O Systems.
Advanced Operating Systems (CS 202) Operating System Structure
Presentation transcript:

Page 1 Towards a Schedu Capturing OS Expertise in an Event Type System: the Bossa Experience Julia L. Lawall DIKU, University of Copenhagen Joint work with: Gilles Muller Obasco Group, Ecole des Mines de Nantes/INRIA

Page 2 Program issues u Approach: exploit the restricted nature of DSLs to address all of these issues. Does nothing wrong Does something right Executes efficiently

Page 3 Context: OS extensibility u Goals: –Policies for specific applications. –Policies for specific execution contexts. –Eliminate unnecessary functionality for speed / reduced resource consumption. u Safety is critical

Page 4 Approaches to OS extensibility u Berkeley Packet Filter: –interpreted for safety u Exo-kernel –extensions run at the user level u Proof-carrying code –extensions accompanied by a correctness proof u SPIN, OKE: –extensions written in a safe language u Address safety, correctness at best ad hoc.

Page 5 A domain-specific approach Bossa, a DSL for developing CPU schedulers RTS Kernel (Linux) DSL policy Compiled policy Bossa compiler/verifier kernel expertpolicy developers

Page 6 Bossa DSL: policy structure u Declarations –states –process attributes –process priorities u OS interface u Programmer interface

Page 7 Extract of a scheduling policy states = { RUNNING running : process; READY ready : select sorted queue; READY expired : sorted queue; READY yield : process; BLOCKED blocked : queue; TERMINATED terminated; }

Page 8 Event handlers handler (event e) { … On block.* { running => blocked; } On unblock.preemptive.* { if (!empty(running) && e.target > running) running => ready; e.target => ready; } … }

Page 9 Correctness issues u Is the chosen algorithm appropriate? u Is the algorithm implemented faithfully? u Does the implementation interact correctly with the target OS? This work focuses on the third issue...

Page 10 Event handlers handler (event e) { … On block.* { running => blocked; } On unblock.preemptive.* { if (!empty(running) && e.target > running) running => ready; e.target => ready; } … } Reasonable behavior, but what does the kernel expect?

Page 11 Event types u For each event, describe: –Event notification context. –Expected handler effect. –block.*: [tgt in RUNNING]  [tgt in BLOCKED] u Provided by the OS expert. u Goals: –Document kernel expectations. –Check that these expectations are satisfied. –Encapsulate kernel expertise. –Policy independent.

Page 12 Event type examples u block.*: –[tgt in RUNNING]  [tgt in BLOCKED]  unblock.preemptive.*: –[tgt in BLOCKED]  [tgt in READY] –[p in RUNNING, tgt in BLOCKED]  [[p, tgt] in READY] u Missing Linux expertise: –unblock.preemptive.* is an interrupt; affects block.*. –a process can be unblocked before it blocks.

Page 13 Corrected types and handlers u block.*: –[tgt in RUNNING]  [tgt in BLOCKED] –[[] = RUNNING, tgt in READY]  [tgt in BLOCKED] On block.* { running => blocked; } should be: On block.* { e.target => blocked; }

Page 14 Corrected types and handlers u unblock.preemptive.*: –[tgt in BLOCKED]  [tgt in READY] –[p in RUNNING, tgt in BLOCKED]  [[p, tgt] in READY] –[tgt in RUNNING]  [tgt in RUNNING] –[[] in RUNNING, tgt in READY]  [tgt in READY] On unblock.preemptive.* { if (e.target in blocked) { if (!empty(running) && e.target > running) running => ready; e.target => ready; }}

Page 15 Event types for safety u bossa.schedule –[[] = RUNNING, q in READY]  [q in RUNNING] On bossa.schedule { if (empty(ready)) { if (empty(expired)) { yield => ready; } else { expired => ready; } select() => running; }

Page 16 Event types for optimization u block.*: –[tgt in RUNNING]  [tgt in BLOCKED] –[[] = RUNNING, tgt in READY]  [tgt in BLOCKED] u Specialized event sequences. if (tgt == running) move_proc_queue(running,blocked); else move_queue_queue(tgt,blocked);

Page 17 Assessment u For critical OS services, need more than safety guarantees. u Analyzing the entire kernel with respect to each new policy is both expensive and not so necessary. u Event types guide the developer and permit relevant verifications.

Page 18 Current status u Bossa versions of Linux 2.2 and 2.4 kernels. u Policies: –Process schedulers: »Linux, BSD, EDF, Progress-based, Linux O(1) –Virtual schedulers: »Fixed-priority, proportional share u Automatic kernel instrumentation in progress u Low overhead for lat_ctx. No overhead for more typical applications.

Page 19 Future work u Test event type expressiveness: –New OSes: »BSD, OSes for real-time or embedded systems... –New policies »multimedia, real-time, energy aware… u Model checking for verifying policies. u Model checking for verifying event types.