Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.

Slides:



Advertisements
Similar presentations
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
Advertisements

Real Time Scheduling.
Time Demand Analysis.
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
Introduction to Embedded Systems Resource Management - III Lecture 19.
Scheduling Algorithms for Multiprogramming in a Hard Real-Time Environment (then and now) EECS 750 – Spring 2006 Presented by: Shane Santner, TJ Staley,
Priority INHERITANCE PROTOCOLS
EE551 Real-Time Operating Systems Modeling IPC and Constraints Course originally developed by Maj Ron Smith.
Boyce/DiPrima 9th ed, Ch 2.8: The Existence and Uniqueness Theorem Elementary Differential Equations and Boundary Value Problems, 9th edition, by William.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CSE 522 Real-Time Scheduling (4)
1 Deferrable Scheduling for Temporal Consistency: Schedulability Analysis and Overhead Reduction Ming Xiong : Lucent Bell Labs Song Han: City University.
Real-Time Scheduling CIS700 Insup Lee October 3, 2005 CIS 700.
Module 2 Priority Driven Scheduling of Periodic Task
Sporadic Server Scheduling in Linux Theory vs. Practice Mark Stanovich Theodore Baker Andy Wang.
Ch 2.4: Differences Between Linear and Nonlinear Equations
HASSO-PLATTNER-INSTITUT für Softwaresystemtechnik GmbH an der Universität Potsdam Multiprocessor Scheduling “Global Multiprocessor Scheduling of Aperiodic.
Chapter 6 Dynamic Priority Servers
Periodic Task Scheduling
Fixed-Priority Servers
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
Embedded Systems Exercise 3: Scheduling Real-Time Periodic and Mixed Task Sets 18. May 2005 Alexander Maxiaguine.
Recap Priorities task-level static job-level static dynamic Migration task-level fixed job-level fixed migratory Baker/ Oh (RTS98) Pfair scheduling This.
Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment Presented by Pete Perlegos C.L. Liu and James W. Layland.
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 –
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –
Technische Universität Dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2007/12/14.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
A Categorization of Real-Time Multiprocessor Scheduling Problems and Algorithms Presentation by Tony DeLuce CS 537 Scheduling Algorithms Spring Quarter.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
Scheduling Aperiodic and Sporadic Jobs
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.
1 Reducing Queue Lock Pessimism in Multiprocessor Schedulability Analysis Yang Chang, Robert Davis and Andy Wellings Real-time Systems Research Group University.
Scheduling policies for real- time embedded systems.
DESIGNING VM SCHEDULERS FOR EMBEDDED REAL-TIME APPLICATIONS Alejandro Masrur, Thomas Pfeuffer, Martin Geier, Sebastian Drössler and Samarjit Chakraborty.
Real Time Operating Systems Schedulability - Part 3 Course originally developed by Maj Ron Smith 10/24/2015Dr Alain Beaulieu1.
Real Time Scheduling Telvis Calhoun CSc Outline Introduction Real-Time Scheduling Overview Tasks, Jobs and Schedules Rate/Deadline Monotonic Deferrable.
Ernest Cachia University of Malta “Real-Time System Development” Slide No. 1 of part 3 n What about jitter? To calculate jitter one should have data regarding.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Real Time Operating Systems Mutual Exclusion, Synchronization & Intertask Communication Course originally developed by Maj Ron Smith.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
Real Time Systems Real-Time Schedulability Part I.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05.
CSE 522 Real-Time Scheduling (2)
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.
Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2012 年 12 月 19 日 These slides use Microsoft clip.
Sandtids systemer 2.modul el. Henriks 1. forsøg m. Power Point.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 3.
Mok & friends. Resource partition for real- time systems (RTAS 2001)
11 G53SRP: Feasibility analysis Chris Greenhalgh School of Computer Science.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Lecture 6: Real-Time Scheduling
Distributed Process Scheduling- Real Time Scheduling Csc8320(Fall 2013)
Real-time Embedded Systems Rate monotonic theory scheduling.
Chapter 6 Dynamic Priority Servers
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
NET 424: REAL-TIME SYSTEMS (Practical Part)
Ch.7 Scheduling Aperiodic and Sporadic Jobs in Priority-Driven Systems
Ch 4. Periodic Task Scheduling
Presentation transcript:

Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1

Outline  Review of RMA and Utilization Bound Testing  Revisiting Critical Instances  Time Demand Analysis  Schedulability & Aperiodic Tasks  Deadline Monotonic Priority Algorithm  Schedulability & Bandwidth Preserving Servers  Deferrable Server Schedulability 12/20/2015 Dr Alain Beaulieu

Utilization based schedulability tests  pros:  usually involves a “simple” computational test  mathematically rigorous  Seminal paper  cons:  not always conclusive  sufficient but not necessary  only valid if the workload model and the underlying assumptions of the test are consistent  can lead to false confidence 12/20/2015 Dr Alain Beaulieu

Alternatives  When utilization based tests are inconclusive, we can always construct a timing graph of the system  construct graph over the interval [0, max {p i }]  if all tasks meet their deadlines within their first period, the system is schedulable  assumes that all tasks are in phase  the problem with this approach is that it will be impractical for most large systems and is not easily automated  As experienced in the first homework  alternative: time-demand analysis 12/20/2015 Dr Alain Beaulieu

Revisiting Critical Instants  Recall that a critical instant is defined as the instant in time that a job is released such that it has the maximum response time of all jobs in the task  think of it as the worst possible time (busiest) to release on the processor  Theorem: in a fixed priority system ( where every job in a task completes before another job in the same task releases), the critical instant for T i occurs when it releases at the same time as a job in each higher priority task 12/20/2015 Dr Alain Beaulieu

Critical Instants  Example 1:  T= { (3,1), (5, 1), (10, 2) }  The critical instant for tasks T 2 and T 3 is T1T1 T2T2 T3T In fact for in phase tasks, a critical instant always exists at t = 0 12/20/2015 Dr Alain Beaulieu

Critical Instants  Example 2:  T= { (1,3,1,3), (5, 1), (10, 2) }  The critical instant for tasks T 2 and T 3 is T1T1 T2T2 T3T /20/2015 Dr Alain Beaulieu

Time-Demand Analysis (D i ≤ p i )  Under time-demand analysis we:  predict the worst case response time for each task going from highest priority to lowest  then compare each task’s response time to its deadline  if all worst case response times are less than their respective deadlines, the system is schedulable  Recall that a tasks response time is its completion time minus its release time This technique is sometimes referred to as response time analysis 12/20/2015 Dr Alain Beaulieu

Worst-Case Response Time  Alternatively, the response time of a task is defined to be the sum of its own worst case computation time and its maximum interference -> w i = e i + I i (1) where I i is the maximum interference * that task i can experience in any time interval [t, w i ) *The condition for maximum interference obviously occurs when all higher priority tasks are released at the same time as task i (in other words, at a critical instant) 12/20/2015 Dr Alain Beaulieu

Counting Releases  Consider task i and a higher priority task j  now, the number of releases of task j in time interval 0 to w i can be derived as follows: # of releases j =  w i /p j  (2) ceiling function [ 0, w i ) ijij 40 5 pipi pjpj # of releases = 2 wiwi 12/20/2015 Dr Alain Beaulieu

Determining Interference  From this, the maximum interference of task j on task i in interval 0 to w i is given by: max interference (task j) =  w i /p j  e j (3)  but there may be other higher priority tasks, therefore: I i =   w i /p j  e j (4) [ 0, w i ) j  hp(i) 12/20/2015 Dr Alain Beaulieu

Calculating Response Time  Substituting equation (4) into (1) gives the general expression for response time: w i = e i +   w i /p j  e j (5)  Note the following issue (problem):  w i is on both sides of this “strange” equation  Before we attempt to solve this equation, let’s first see if we can understand it j  hp(i) 12/20/2015 Dr Alain Beaulieu

Understanding Response Time T = { (100, 20), (150, 30), (250, 60) } w 3 = e 3 +  w 3 /p 1  e 1 +  w 3 /p 2  e 2 = (20) + 1(30) {by viewing the graph} = T1T2T3T1T2T3 w 3 = /20/2015 Dr Alain Beaulieu

Solving the Response Time Equation  Essentially, form a recursive relationship with equation (5) and solve iteratively: w i n+1 = e i +   w i n / p j  e j (6) where initial (seed) value w i 0 = e i  The algorithm then becomes: solve for successive values of w i n+1 if w i n+1 = w i n, then solution found -> w i = w i n if w i n+1 > D i, then task i cannot meet its deadline j  hp(i) 12/20/2015 Dr Alain Beaulieu

Response Time Analysis Example Given T = { (7,3), (12, 3), (20,5) }  Use RMA scheduling  Apply the utilization based schedulabilty test  If necessary, use time-demand analysis to determine whether the system is schedulable 12/20/2015 Dr Alain Beaulieu

Schedulability & Asynchronous Tasks  The simple task model that we have been able to deal with thus far is restrictive in several ways. Not being able to handle asynchronous tasks is a major restriction.  One approach is to make asynchronous tasks resemble periodic tasks  consider that an asynchronous task’s minimum inter-arrival time can be treated like a period, T  with just this assumption one can use RMA to extend to both types of tasks, BUT 12/20/2015 Dr Alain Beaulieu

Deadline Monotonic Priority Ordering  The simple task model assumption that D=p is also unrealistic for most asynchronous tasks  often, an asynchronous task will occur infrequently (large inter-arrival time) but must be serviced quickly -> D < p  therefore priority assignment based upon p will usually not satisfy the requirement to meet D  The deadline monotonic priority ordering (DMPO) scheme is introduced as follows:  the shorter the task deadline, the higher the priority 12/20/2015 Dr Alain Beaulieu

DMPO Example Taske i p i D i  i w i *  * Response times are calculated using the methods presented earlier using equation (6) Note that a rate monotonic ordering would not schedule these tasks 12/20/2015 Dr Alain Beaulieu

Schedulability & BP Servers  Recall that a bandwidth preserving server is a type of polling server that permits the budget of the server to be preserved until later in the period should an asynchronous job arrive  We described two general classes of bandwidth preserving server:  deferrable server  sporadic server How do we determine the schedulability of the system in the presence of bandwidth preserving servers? 12/20/2015 Dr Alain Beaulieu

Recall: Deferrable Servers  A deferrable server is a bandwidth preserving server with period p s and execution budget e s which  preserves its budget if idle, and  replenishes its budget fully every period  Budgets are not allowed to accumulate from period to period  Since the deferrable server is purely periodic, it can be assigned priority along with all other periodic tasks  … and, for reasons that will now be explained, we must ensure that the priority of the deferrable server is higher than all other periodic tasks 12/20/2015 Dr Alain Beaulieu

Recall the Deferrable Server Example  The schedule for this system is given below: T= {(2, 3.5, 1.5, 3.5), (6, 0.5) } T DS = (3,1) A 1 = (2.5, 2) 024 T1T1 T2T2 T DS 68 1/ Note:  = {T DS, T 1, T 2 } 12/20/2015 Dr Alain Beaulieu

Critical Instants & Systems with Deferrable Servers  In order to use time demand analysis on a system with a deferrable server, a critical instant, t 0, must be found as follows:  at t 0 a job of task i is released  a job in every higher priority task is also released at t 0  a (higher priority) deferrable server has:  a full budget e s at t 0  an asynchronous job is released at t 0,  a full asynchronous backlog exists for an extended time (beyond w i ), and  the next replenishment is at t 0 + e s 12/20/2015 Dr Alain Beaulieu

Critical Instants in Systems with Deferrable Servers  To understand the critical instant in the presence of a deferrable server, study the graph below  note how the worst case release time for any periodic task occurs when T DS has (and uses) its full budget just prior to getting a full replenishment t0t0 T1T1 T2T2 T DS eses eses eses eses eses 12/20/2015 Dr Alain Beaulieu

Time-Demand Analysis with Deferrable Servers (D i ≤ p i )  Understanding this formula: w i = e i + e s +  (w i -e s ) / p s  e s +   w i /p k  e k k  hp(i), excluding T DS execution of deferrable server immediately following critical instant 12/20/2015 Dr Alain Beaulieu

Time-Demand Analysis with Deferrable Servers (D i ≤ p i )  Understanding this formula: w i = e i + e s +  (w i -e s ) / p s  e s +   w i /p k  e k k  hp(i), excluding T DS interference of the deferrable server, T DS, in the interval (t 0 +e s, w i ] 12/20/2015 Dr Alain Beaulieu

Time-Demand Analysis with Deferrable Servers (D i ≤ p i )  Understanding this formula: w i = e i + e s +  (w i -e s ) / p s  e s +   w i /p k  e k k  hp(i), excluding T DS interference of all k higher priority tasks, excluding the deferrable server, T DS 12/20/2015 Dr Alain Beaulieu

Exercise  Draw the schedule for the system below  (go out far enough in time to include as a minimum the completion of the first job in each periodic task and all aperiodic jobs)  Determine the response time of A 1  Determine the worst case response time of all periodic tasks  Is the system schedulable?  T={ (5, 1.5), (7, 2) }  T DS = ( 4, 1), A = {(0.5, 2.5), (2.5, 0.25)} 12/20/2015 Dr Alain Beaulieu

Exercise Solution  draw the schedule for the system below 12/20/2015 Dr Alain Beaulieu

Exercise Solution  determine the response time of A 1 w A1 = = 8 w A2 = = 6.25  determine the worst case response time of all periodic tasks w 1 1 = e 1 + e s +  (w 1 0 -e s ) / p s  e s where w 1 0 = 1.5 =  (1.5 -1) / 4  (1) = 3.5 w 1 2 =  (3.5 -1) / 4  (1)= 3.5 therefore w 1 = 3.5  D 1 (worst-case) 12/20/2015 Dr Alain Beaulieu

Exercise Solution  determine the worst case response time of all periodic tasks (continued) w 2 1 = e 2 + e s +  (w 2 0 -e s ) / p s  e s +  (w 2 0 ) / p 1  e 1 w 2 0 = 2 =  (2 -1) / 4  (1) +  2 / 5  (1.5) = 5.5 w 2 2 = 3 +  (5.5 -1) / 4  (1) +  5.5 / 5  (1.5) = 8 w 2 3 = 3 +  (8 -1) / 4  (1) +  8/ 5  (1.5) = 8 therefore w 2 = 8 > D 2 (worst-case)  is the system schedulable? No since all tasks do not meet their deadlines under worst-case conditions, we can not guarantee the system schedulable 12/20/2015 Dr Alain Beaulieu

References [1] Liu, J.W.S., “Real-Time Systems”, Prentice-Hall, [2] Burns, A. and Wellings, A., “Real-Time Systems and Programming Languages”, Chapter 13, Addison Wesley, 1997 [3] TimeSys Corp, “The Concise Handbook of Real-Time Systems”, Version 1.0, /20/2015 Dr Alain Beaulieu