CPU Reservations and Time Constraints: Efficient, Predictable Scheduling of Independent Activities Michael B. Jones, Microsoft Research Daniela Roşu, Georgia.

Slides:



Advertisements
Similar presentations
Vassal: Loadable Scheduler Support for Multi-Policy Scheduling George M. Candea, Oracle Corporation Michael B. Jones, Microsoft Research.
Advertisements

Scheduling Introduction to Scheduling
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
Application Performance in the QLinux Multimedia Operating System Jun Wang Jun Wang.
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Abdulrahman Idlbi COE, KFUPM Jan. 17, Past Schedulers: 1.2 & : circular queue with round-robin policy. Simple and minimal. Not focused on.
1 Augmented CPU Reservations John Regehr John A. Stankovic University of Virginia May 31, 2001.
Distributed Multimedia Systems
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
CPU Reservations and Time Constraints: Implementation Experience on Windows NT John Regehr – University of Virginia Michael B. Jones – Microsoft Research.
1 Pertemuan 8 Penjadwalan (lanjutan) Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Towards Resource Aware Applications and Systems Michael B. Jones Microsoft Research.
Building Resource-Aware Applications and Systems Michael B. Jones Microsoft Research.
Computer Science Surplus Fair Scheduling: A Proportional-Share Scheduling Algorithm for Symmetric Multiprocessors Abhishek Chandra Micah Adler Pawan Goyal.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Pipelined Two Step Iterative Matching Algorithms for CIOQ Crossbar Switches Deng Pan and Yuanyuan Yang State University of New York, Stony Brook.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Scheduling policies for real- time embedded systems.
NUS.SOC.CS5248 Ooi Wei Tsang 1 CPU Scheduling. NUS.SOC.CS5248 Ooi Wei Tsang 2 Scheduling Task vs I/O Request Task computation time unpredictable Task.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
OPERETTA: An Optimal Energy Efficient Bandwidth Aggregation System Karim Habak†, Khaled A. Harras‡, and Moustafa Youssef† †Egypt-Japan University of Sc.
Summary :-Distributed Process Scheduling Prepared By:- Monika Patel.
2.5 Scheduling Given a multiprogramming system. Given a multiprogramming system. Many times when more than 1 process is waiting for the CPU (in the ready.
1 Scheduling Processes with Release Times, Deadlines, Precedence and Exclusion Relations J. Xu and D. L. Parnas IEEE Transactions on Software Engineering,
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
1 Course Matters. NUS.SOC.CS5248 OOI WEI TSANG 2 Paper Review October 2003 MonTueWedThuFriSatSun Paper Reviews Due 20% off for each.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
Scheduling.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
CHaRy Software Synthesis for Hard Real-Time Systems
OPERATING SYSTEMS CS 3502 Fall 2017
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Operating Systems Design (CS 423)
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Chapter 5a: CPU Scheduling
Processes and Threads Processes and their scheduling
Networks and Operating Systems: Exercise Session 2
Wayne Wolf Dept. of EE Princeton University
Unit OS9: Real-Time and Embedded Systems
Unit OS4: Scheduling and Dispatch
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Real-time Software Design
Chapter 6: CPU Scheduling
CS140 – Operating Systems Midterm Review
Operating Systems Bina Ramamurthy CSE421 11/27/2018 B.Ramamurthy.
Jason Neih and Monica.S.Lam
TDC 311 Process Scheduling.
Dynamic Voltage Scaling
CSCI1600: Embedded and Real Time Software
Process scheduling Chapter 5.
Virtual-Time Round-Robin: An O(1) Proportional Share Scheduler
Outline Scheduling algorithms Multi-processor scheduling
John Regehr and Jack Stankovic University of Virginia
Chapter 6: CPU Scheduling
Presented By: Darlene Banta
Shortest-Job-First (SJR) Scheduling
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
EECE.4810/EECE.5730 Operating Systems
CSE 542: Operating Systems
CPU Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

CPU Reservations and Time Constraints: Efficient, Predictable Scheduling of Independent Activities Michael B. Jones, Microsoft Research Daniela Roşu, Georgia Tech Marcel-Cătălin Roşu, Georgia Tech

Goal: Coexisting Independent Real-time Applications Independently developed Predictable concurrent execution of real-time and non-real-time apps Meeting all apps timing needs Informing apps when not possible

What did we build? Algorithms enabling practical, predictable execution of multiple real-time and non-real-time apps System implementing these algorithms

Teaser Capability Apps can ask scheduler: Can I do 5ms of work between now+30ms and now+40ms? Scheduler answers either: I guarantee it or You probably cant Guaranteeing this 5ms work in future 10ms interval does not require reserving 50% of CPU for next 40ms

How did we do it? Explicitly represent future time Map app declarations of timing needs into grants of future time Enables: Advance guarantees to applications, or Denial of requests up front

Scheduling of Independently Authored Applications System support for adaptive apps Apps requests based only on their local properties No inter-app coordination needed As opposed to priorities Guarantees hold independent of other activities behavior

Research Context Rialto real-time operating system Research version of ITV kernel Microsoft Interactive TV system Commercial trial in Yokosuka, Japan Tiger Video Fileserver

Outline Research Goals Programming Model Scheduling Architecture How much does it cost? What can it do? Conclusions

Programming Model Activities CPU Reservations Time Constraints

Abstraction: Activity Resources allocated to, charged against Each application typically a distinct activity Each thread belongs to an activity Threads within activity assumed to cooperate Rialto kernel also uses activities

Abstraction: CPU Reservation Guaranteed execution rate and granularity for an activity X units of time out of every Y units, e.g. 800µs every 5ms 7.5ms every 33.3ms one second every minute Continuously guaranteed

Sensitivity to Reservation Amount and Period AVI player, 89% combined reservations for player and background load activity

Abstraction: Time Constraint Deadline-based thread execution Guarantees execution within interval, or Proactively denies constraint request schedulable = BeginConstraint (time_interval, estimate); if (schedulable) then Do normal work under constraint else Transient overload -- shed load if possible time_taken = EndConstraint ();

Example: CPU Reservation & Time Constraints Activities:Estimate: Time with reservations and constraints Start Time:Deadline:

Example: Time Constraints & no CPU Reservations Activities:Estimate: Time with reservations Start Time:Deadline: with reservations and constraints

Related Work Two classes of related work Those using virtual time Goyal et al., Stoica et al., Mercer et al., Nieh & Lam Those using real time Schwan & Zhou, Maruti project at UMD Our system Uses compact representation of real time: Precomputed Scheduling Plan

Outline Research Goals Programming Model Scheduling Architecture How much does it cost? What can it do? Conclusions

Key Insight Precomputed Scheduling Plan Allocation of future time intervals to Activities: for CPU Reservations Threads: for Time Constraints Enables efficient: Scheduling decisions Feasibility analysis for constraints Guarantees for reservations, constraints

Scheduling Plan Example

Scheduling Graph Construction Occurs only when reservations change Goals Minimize context switches Maximize execution intervals Distribute free nodes evenly over time Account for context switch time Quick, non-optimal solution to NP- hard problem

Constraint Feasibility Analysis Feasibility Analysis First considers activity reservation nodes Then considers free graph nodes Infeasible constraints denied Feasible constraints accepted and guaranteed Time intervals in graph are assigned to their execution

EDF Constraint Execution Constraints executed in EDF order During the intervals assigned to constraints Improves cache locality Eliminates timeslicing among constraints

Additional Goals Fair sharing of free CPU among activities Fair sharing of CPU among threads within same activity Unless threads use constraints or synchronization objects Best effort to: finish underestimated constraints expedite denied constraints

Next Thread Selection 1.If time remaining within node below threshold, select next node 2.If during assigned time interval, execute constraint EDF 3.If reserved node, select best thread within activity (default round-robin) 4.Select best activity (default round- robin), and thread within it

Thread Selection Within Activity Selected in order: 1.Threads w/ pending denied constraints 2.Threads w/ late constraints 3.Round-robin among runnable threads Note: Only applies when time interval not assigned for time constraint execution

Outline Research Goals Programming Model Scheduling Architecture How much does it cost? What can it do? Conclusions

On 200MHz Pentium Pro PC: 21.2µs Context switch time 32µs (10µs + 22µs trap) Atomic EndConstraint()/BeginConstraint() CPU reservation operations: 150µs (19µs + 131µs RPC) Incr. Add() 98µs (11µs + 87µs RPC) Release() Micro-benchmark Times

On 200MHz Pentium Pro PC: 21.2µs median context switch time Compare w/ 8.75µs NT4, 239µs deployed ITV kernel 32µs (10µs + 22µs trap) atomic EndConstraint()/BeginConstraint() CPU reservation operations: 150µs (19µs + 131µs RPC) incr. Add() 98µs (11µs + 87µs RPC) Release() Micro-benchmark Times

Cost of Scheduling Plan Changes Time fully reserved - 58 activities, each reserving 400µs per: 1s, 1s, 500ms, 1s, 500ms, 250ms, 1s, 500ms, 250ms, 125ms, … Reasonable even in pathological cases

Costs of Feasibility Analysis Same 58 simultaneous activities, 4 threads each Threads request 300µs within 3s in future Reasonable even in pathological cases

Outline Research Goals Programming Model Scheduling Architecture How much does it cost? What can it do? Conclusions

Achieving Bounded Response: Time Constraints against Time Sharing Time to complete 50ms of work, no reservations Desired responsiveness achieved under load

Achieving Bounded Response: Constraints & Reservations against Reservations Time to complete 50ms work with constraints, competing activities with 10% reservations Bounded response achieved with reservation

Adding Reservations to Existing Apps 1 MPEG & 5 AVI players, w/ reservations on Rialto CPU reservations improve performance

Outline Research Goals Programming Model Scheduling Architecture How much does it cost? What can it do? Conclusions

Conclusions Precomputed scheduling plans enable efficient implementation of: Continuously guaranteed CPU reservations Time constraints with accurate a priori feasibility analysis Abstractions support incremental development, co-existence of independent real-time applications General-purpose OSs can provide practical, efficient, real-time services

Acknowledgments OS Research Group at Microsoft Research Microsoft Interactive TV Team Kevin Jeffay, Karsten Schwan, Patricia Jones, Susan Owicki, George Candea, Jason Nieh

For More Information SOSP 97 CD includes simulator used to develop algorithms Also see