Real-time Scheduling Review Venkita Subramonian Research Seminar on Software Systems February 2, 2004.

Slides:



Advertisements
Similar presentations
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Advertisements

Real Time Scheduling.
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
Priority Inheritance and Priority Ceiling Protocols
Washington WASHINGTON UNIVERSITY IN ST LOUIS Resource and Resource Access Control Fred Kuhns Applied Research Laboratory Computer Science and Engineering.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
CSE 522 Real-Time Scheduling (3)
CSE 522 Real-Time Scheduling (4)
Mehdi Kargahi School of ECE University of Tehran
Real-Time Scheduling CIS700 Insup Lee October 3, 2005 CIS 700.
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.
Module 2 Priority Driven Scheduling of Periodic Task
SIGMETRICS 2008: Introduction to Control Theory. Abdelzaher, Diao, Hellerstein, Lu, and Zhu. CPU Utilization Control in Distributed Real-Time Systems Chenyang.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Spring 2002Real-Time Systems (Shin) Rate Monotonic Analysis Assumptions – A1. No nonpreemptible parts in a task, and negligible preemption cost –
Misconceptions About Real-time Computing : A Serious Problem for Next-generation Systems J. A. Stankovic, Misconceptions about Real-Time Computing: A Serious.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
The Design and Performance of A Real-Time CORBA Scheduling Service Christopher Gill, David Levine, Douglas Schmidt.
Module 2 Clock-Driven Scheduling
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
Practical Schedulability Analysis for Generalized Sporadic Tasks in Distributed Real-Time Systems Yuanfang Zhang 1, Donald K. Krecker 2, Christopher Gill.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Scheduling policies for real- time embedded systems.
Multiprocessor Real-time Scheduling Jing Ma 马靖. Classification Partitioned Scheduling In the partitioned approach, the tasks are statically partitioned.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
1 Scheduling Processes with Release Times, Deadlines, Precedence and Exclusion Relations J. Xu and D. L. Parnas IEEE Transactions on Software Engineering,
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
End-To-End Scheduling Angelo Corsaro & Venkita Subramonian Department of Computer Science Washington University Distributed Systems Seminar, Spring 2003.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
Special Class on Real-Time Systems
CSE 522 Real-Time Scheduling (2)
Module 2 Overview of Real Time System Scheduling
Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Introduction to Embedded Systems Rabie A. Ramadan 5.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Dynamic Priority Driven Scheduling of Periodic Task
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
Introduction to Real-Time Systems
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
For a good summary, visit:
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Clock Driven Schedulers
Lecture 6: Real-Time Scheduling
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Real-Time Operating Systems RTOS For Embedded systems.
Embedded System Scheduling
Scheduling and Resource Access Protocols: Basic Aspects
Unit OS9: Real-Time and Embedded Systems
EEE 6494 Embedded Systems Design
Real-time Software Design
Lecture 24: Process Scheduling Examples and for Real-time Systems
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall2014 9/20/2018.
زمان‌بندی پردازه‌ها در سیستم‌های توزیع‌شده استاد درس:
Realtime System Fundamentals : Scheduling and Priority-based scheduling B. Ramamurthy cse321-fall /27/2018.
CSCI1600: Embedded and Real Time Software
Networked Real-Time Systems: Routing and Scheduling
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Real-Time Process Scheduling Concepts, Design and Implementations
Ch 4. Periodic Task Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

Real-time Scheduling Review Venkita Subramonian Research Seminar on Software Systems February 2, 2004

Main Topics for Discussion  Single Processor Scheduling  End-to-end Scheduling  Holistic Scheduling

What is a Real-time System?  Real-time systems have been defined as: “those systems in which the correctness of the system depends not only on the logical result of the computation, but also on the time at which the results are produced";  J. Stankovic, "Misconceptions About Real-Time Computing," IEEE Computer, 21(10), October  Real-time does not necessarily mean “Real fast”.  Predictability is key in real-time systems  “There was a man who drowned crossing a stream with an average depth of six inches” – J. Stankovic

Real-time Scheduling  Job (J ij ): Unit of work, scheduled and executed by system. Jobs repeated at regular or semi-regular intervals modeled as periodic  Task (T i ): Set of related jobs.  Jobs scheduled and allocated resources based on a set of scheduling algorithms and access control protocols.  Scheduler: Module implementing scheduling algorithms  Schedule: assignment of all jobs to available processors, produced by scheduler.  Valid schedule: All jobs meet their deadline  Clock-driven scheduling vs Event(priority)-driven scheduling  Fixed Priority vs Dynamic Priority assignment

Scheduling Periodic Tasks  In hard real-time systems, set of tasks are known apriori  Task T i is a series of periodic Jobs J ij. Each task has the following parameters  p i - period, minimum interrelease interval between jobs in Task T i.  e i - maximum execution time for jobs in task T i.  r ij - release time of the j th Job in Task i (J ij in T i ).   i - phase of Task T i, equal to r i1.  u i - utilization of Task T i = e i / p i  In addition the following parameters apply to a set of tasks  H - Hyperperiod = Least Common Multiple of p i for all i: H = lcm(p i ), for all i.  U - Total utilization = Sum over all u i.  Schedulable utilization of an algorithm U s  If U < U s the set of tasks can be guaranteed to be scheduled

Fixed Priority Algorithms  Rate Monotonic scheduling  Priority assignment based on rates of tasks  Higher rate task assigned higher priority  Schedulable utilization = (Liu and Leyland)  If U < 0.693, schedulability is guaranteed  Tasks may be schedulable even if U >  Deadline Monotonic scheduling  Priority assignment based on relative deadlines of tasks  Shorter the relative deadline, higher the priority  Useful when relative deadline ≠ period  Both of the above usually done off-line since fixed priority assigned at task level  Online dispatcher enforces the schedule by dispatching higher priority jobs before lower priority jobs

Dynamic Priority Algorithms  Online scheduler assigns priorities for jobs released  Dispatcher dispatches the highest priority job  Suitable for scheduling aperiodic as well as periodic tasks  Earliest Deadline First (EDF)  Priority assignment based on absolute deadline of jobs  Job with closest deadline assigned highest priority  Schedulable utilization = 1  Least Laxity First (LLF)  Laxity = Absolute Deadline – Worst case computation time  Priority assignment based on laxity of jobs  Job with minimum laxity assigned highest priority  Schedulable utilization = 1  Dynamic Priority algorithms provide better processor utilization than Fixed Priority algorithms

Hybrid algorithms  Not all algorithms are robust in overload situations  To improve predictability for critical tasks, use a combination of fixed and dynamic priority algorithms  Tasks divided based on criticality – critical and non-critical  Critical tasks scheduled using fixed priority assignment  Non-critical tasks scheduled based on dynamic priority assignment  Examples - Maximum Urgency First, RM + MLF

Blocking factors  Sometimes a higher priority job cannot run because  Currently running lower priority job is non-preemptive (priority- inversion)  E.g., non-preemptable system call  Self-suspension  E.g., i/o operations, remote calls  Above blocking delays need to be taken into account while doing schedulability analysis  Blocking delay should include  Maximum blocking time due to non-preemptability of lower priority tasks  Maximum own self suspension time and maximum self-suspension time of all higher priority tasks  Context switches

ORB endsystem example (1/2) Wait-on-Connection  ReplyHandler in ORB waits on socket connection for the reply  Blocking call to recv()  One less thread listening on the Reactor for new requests  No interference from other requests that arrive when reply is pending  However, could cause deadlocks on nested upcalls. Wait-on-Reactor  ReplyHandler waits in reactor for the reply  Reactor gets a chance to process other requests while replies are pending  Interleaving of request reply processing, hence interference from other requests while reply is pending  Ideal for single threaded processing

ORB endsystem example (2/2)  Wait-on-Reactor strategy could cause interleaved request/reply processing  Blocking factor could be bounded or unbounded  Based on the upcall duration  And number of intervening upcalls  Blocking factors may affect real-time properties of other end-systems  Call-chains can have a cascading blocking effect f2f2 f5f5 f3f3 f6f6 f 5 reply queued f 3 returns f 5 reply processed f 2 returns Blocking factor for f 2

Algorithm selection PeriodicRMS/MUF/DM Periodic, BlockingRMS/MUF/DM with Priority Ceiling Periodic?, Predictable Overload behavior MUF, RM+MLF Maximum UtilizationEDF,MLF Single Processor

End­to­End Scheduling

End-to-end task model  A task is composed of multiple subtasks running on multiple processors  Remote method invocation  Non-local event  Messages  Subtasks are subject to precedence constraints  Task = a chain of subtasks  A task is subject to an end-to-end deadline  Does not care about the response time of a particular subtask  End-to-End scheduling should address  Task allocation : bind tasks to processors  Synchronization protocols : to enforce precedence constraints  Subdeadline assignment  Schedulability analysis Thanks to Dr. Lu for permitting to use material from CS520 slides

Task Allocation  Strategies  Offline, static allocation  Allocate a task when it arrives  Re-allocate (migrate) a task after it starts  NP-hard: heuristics needed  Bin-Packing formulation  Pack subtasks to bins (processors) with limited capacity  “Size” of a subtask Ti,j: ui,j = ei,j/pi  “Capacity” of each bin is its utilization bound, e.g., 0.69 (RMS) or 1 (EDF) under ideal assumptions  Goal: minimize the number of bins subject to the capacity constraints Thanks to Dr. Lu for permitting to use material from CS520 slides

The Synchronization Problem  Given that  Priorities are assigned to subtasks in a task chain using some fixed priority assignment algorithm  How do we coordinate the release of subtasks in a task chain so that  Precedence constraints among subtasks are satisfied  subtask deadlines are met  end-to-end deadlines are met

Synchronization Protocols  Direct Synchronization (DS) Protocol  Simple and straightforward  Phase Modification (PM) Protocol  Proposed by Bettati  Extension called Modified Phase Modification (MPM) Protocol  Release Guard Protocol  Proposed by Sun

Synchronization Protocol - Example P1P2 (4,2) T1T1 (6,2) T 2,1 (6,2) T 2,2 (6,3) T3T3 T i,j – j th subtask of task T i (period,execution time) Period = relative deadline of parent task Task T3 has a phase of 4 time units

Direct Synchronization Protocol  Greedy strategy  On completion of subtask  A synchronization signal sent to the next processor  Successor subtask competes with other tasks/subtasks on the next processor

Direct Synchronization Illustrated On P1 On P2 T1T1 T 2,1 T 2,2 T3T Phase of T 3 T 3 misses deadline P1P2 (4,2) T1T1 (6,2) T 2,1 (6,2) T 2,2 (6,3) T3T3

Phase Modification Protocol  Proposed by Bettati  Release subtasks periodically  According to the periods of their parent tasks  Each subtask given its own phase  Phase determined by subtask precedence constraints

Phase Modification Protocol Illustrated (1/2) T 1,1 T 1,2 T 1,3 T 1,1 T 1,2 T 1,3 Actual response time Estimated worst case response time Phase of T 1,2 Phase of T 1,3 p1p1 p1p1 p1p1

Phase Modification Protocol Illustrated (2/2) On P1 On P2 T1T1 T 2,1 T 2,2 T3T Phase of T 3 P1P2 (4,2) T1T1 (6,2) T 2,1 (6,2) T 2,2 (6,3) T3T3 Phase of T 2,2

Phase Modification Protocol - Analysis  Periodic Timer interrupt to release subtasks  Centralized clock or strict clock synchronization  Task overruns could cause Precedence constraint violations

Modified PM Protocol Illustrated (1/2) T 1,1 T 1,2 T 1,1 T 1,2 T 1,3 Actual response time Estimated worst case response time p1p1 Overrun ∆ p 1 + ∆

Modified PM Protocol Illustrated (2/2) On P1 On P2 T1T1 T 2,1 T 2,2 T3T Phase of T 3 P1P2 (4,2) T1T1 (6,2) T 2,1 (6,2) T 2,2 (6,3) T3T3 Synch signal delayed

Modified PM Protocol - Analysis  MPM protocol behavior the same as PM under ideal conditions  Ideal conditions – Clocks synchronized, no overrun  MPM protocol does not need clock synchronization  Precedence constraints preserved even in the case of overruns  Upper bound on End-to-End Response time of task T i R i,k is the response time of the k th subtask of T i n i is the number of subtasks for the task T i  Lower bound on End-to-End Response time of task T i + Actual Response time of n i th subtask  Lower bound high, hence high average EER time, but low output jitter

Release Guard Protocol  Proposed by Sun  A guard variable – release guard - associated with each subtask  Release guard used to control release of each subtask  Contains next release time of subtask  Synchronization signals just like MPM  Release guard updated  On getting synchronization signal  During idle time

Release Guard Protocol Illustrated On P1 On P2 T1T1 T 2,1 T 2,2 T3T Phase of T 3 P1P2 (4,2) T1T1 (6,2) T 2,1 (6,2) T 2,2 (6,3) T3T3 g 1,2 = 4+6=10g 1,2 = 9 Idle time detected

Release Guard Protocol - Analysis  Shares the same advantages as MPM  Upper bound on EER still the same as MPM  Since upper bound on release time enforced by release guard R i,k is the response time of the k th subtask of T i n i is the number of subtasks for the task T i  Lower bound on EER less than that of MPM  If there are idle times  Results in lower average EER

Subdeadline Assignment  Subdeadline -> priorities under EDF & DM  Optimal subdeadline assignment is NP-hard  Offline: heuristic search algorithms  Online: simpler heuristics  Effective Deadline (ED):  Work backwards from the end-to-end deadline  Slack assignment  Assign all slack to 1st subtask  Assign slack proportionally to execution time  Assign more slack to subtasks on busier processors Thanks to Dr. Lu for permitting to use material from CS520 slides

Holistic Scheduling  Combine processor scheduling with communication bus scheduling to provide an integrated schedulability analysis  Calculate bounds on end-to-end delays in distributed systems including communication delays  Typically used in hard real-time systems to calculate the worst case end- to-end response time of tasks

Algorithm selection  Use MPMP or RG if  Information about all tasks are available a priori  System has global clock sync  Otherwise only RG can be used  Use MPMP for low jitter and RG for lower average EER

References  Synchronization Protocols in Distributed Real-Time Systems, ICDCS 96  Jun Sun, Jane Liu  Real-time Systems  Jane Liu  Holistic Schedulability for Distributed Hard Real-time Systems, Microprocessing and Microprogramming - Euromicro Journal 1994 (Special Issue on Parallel Embedded Real-Time Systems)  Ken Tindell, John Clark  VEST: An Aspect-Based Composition Tool for Real-Time Systems, RTAS 2003  Stankovic, Lu, et.al

DM with phase offset