Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environments.

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

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
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.
CPE555A: Real-Time Embedded Systems
An Introduction to Real Time Systems
Task Allocation and Scheduling n Problem: How to assign tasks to processors and to schedule them in such a way that deadlines are met n Our initial focus:
Module 2 Priority Driven Scheduling of Periodic Task
Towards Feasibility Region Calculus: An End-to-end Schedulability Analysis of Real- Time Multistage Execution William Hawkins and Tarek Abdelzaher Presented.
Preemptive Behavior Analysis and Improvement of Priority Scheduling Algorithms Xiaoying Wang Northeastern University China.
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
RTOS Scheduling – I : Rate-Monotonic Theory
EE 249, Fall Discussion: Scheduling Haibo Zeng Amit Mahajan.
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.
Technische Universität Dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2007/12/14.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
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.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 31 – Multimedia OS (Part 1) Klara Nahrstedt Spring 2011.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
CompSci 143A1 5. Process and thread scheduling 5.1 Organization of Schedulers – Embedded and Autonomous Schedulers – Priority Scheduling 5.2 Scheduling.
6. Application mapping 6.1 Problem definition
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
RTOS task scheduling models
CSE 522 Real-Time Scheduling (2)
Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.
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.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
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
Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2012 年 12 月 19 日 These slides use Microsoft clip.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
CS333 Intro to Operating Systems Jonathan Walpole.
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 32 – Multimedia OS Klara Nahrstedt Spring 2010.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Fault-Tolerant Rate- Monotonic Scheduling Sunondo Ghosh, Rami Melhem, Daniel Mosse and Joydeep Sen Sarma.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
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
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Scheduling and Resource Access Protocols: Basic Aspects
EEE 6494 Embedded Systems Design
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
CSCI1600: Embedded and Real Time Software
Chapter 6: CPU Scheduling
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Chapter 10 Multiprocessor and Real-Time Scheduling
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: CPU Scheduling
Ch 4. Periodic Task Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environments Gracia Yuen UM

Agenda Target of the presentation Background 1 Target of the presentation 2 Background 3 A Fixed Priority Scheduling Algorithm 5 A Deadline Driven Scheduling Algorithm 6 A Mixed Scheduling Algorithm 7 Algorithm Comparison 8 Conclusion

Based on existed two ideas: 1. Fixed priority scheduling Target of the presentation Discuss the proper algorithm of multiprogram scheduling for services in Hard-Real-Time environment on a single processor. Based on existed two ideas: 1. Fixed priority scheduling 2. Dynamically assigning priority scheduling. try to find an optimum combination idea for the Hard-Real-Time services.

Requirements & Background 2 Background 2-1 Requirements & Background 2-2 Definition of Concept 2-3 Constraint Conditions of Modeling

2 Background 2-1 Requirements & Background 1. Design is triggered requirements. The rapidly increased computer use for Control&Monitoring of industrial processes. 2. The validity of embedded realtime system includes: 1) the correctness of the program logic; 2) meet the time constraint condition.

2 Background 2-1 Requirements & Background 3. Based on the requirements of Real-Time, real-time system can be divided as: 1) Hard-real-time it is mandatory to meet the deadline of response time; 2) Soft-real-time a statistical distribution of response times is acceptable;

2 Background 2-1 Requirements & Background 4. Based on scheduling, real-time system can be divided as: 1) Static Scheduling Algorithms are based on RMS; 2) Dynamic Scheduling Algorithms are based on EDF or LLF.

2 Background 2-1 Requirements & Background 5. Based on Real-Time Scheduling, real-time system can be divided as: 1) single processor scheduling; 2) centralized multiprocessor scheduling; 3) distributed processor scheduling;

2 Background 2-1 Requirements & Background 6. Based on whether or not preemption is available, real-time system can be divided as: 1) preemptive scheduling; 2) non-preemptive scheduling; 7. This paper is discussed Only on: 1) single process system; 2) preemptive scheduling;

1) More than 1 functions on a computer; 2 Background 2-2 Definition of Concept 2. Function 1) More than 1 functions on a computer; 2) Associated with a set of tasks; 3. Task 1) Time-driven; 2) Processes a fixed time to elapse/task. => service is guaranteed in the time. 3) Preemptive;

consist of run-ability constraints Only; 2 Background 2-3 Constraint Conditions of Modeling 1. Task 1) Periodic task; 1> independent; 2> has deadline; consist of run-ability constraints Only; no queuing problem for individual task; 3> constant interval between tasks; Note: Periodic task is one scenarios of tasks in time-critical control & monitoring functions.

2 Background 2-3 Constraint Conditions of Modeling 4> run-time of each task is constant; run-time is an approximation value; the maximum processing time for a task task ti tast requirest period: Tm;= 1/requiret-rate 2) Non-Periodic task; 1> Initialization or Failure RR; 2> no critical deadline;

=>eliminates queuing problem for the individual task. 2 Background 2-3 Constraint Conditions of Modeling 2. Assumptions: The requests for all tasks for which hard deadlines exist are periodic, with constant interval between requests. Deadlines consist of run-ability constraints only – i.e. each task must be completed before the next request for it comes. =>eliminates queuing problem for the individual task.

2 Background 2-3 Constraint Conditions of Modeling 2. Assumptions: The tasks are independent in that requests for a certain task do not depend on the initiation or the completion of requests for other tasks. Run-time for each task is constant for that task and does not vary with time. Run-time here refers to the time which is taken by a processor to execute the task without interruption.

2 Background 2-3 Constraint Conditions of Modeling 2. Assumptions: Any non-periodic tasks in the system are special; they are initialization or failure-recovery routines; they displace periodic tasks while they themselves are being run, and do not themselves have hard, critical deadlines. Delays caused by the single processor, the preemptive scheduling and task switching, are ignored.

2 Background 2-3 Constraint Conditions of Modeling 3. Scheduling algorithms will be discussed: 1) Fixed priority scheduling 2) Dynamic priority scheduling: priorities of tasks might change from request to request. 3) Mixed scheduling algorithm the priority of some tasks are fixed and others are vary from request to request.

A Fixed Priority Scheduling Algorithm 3 A Fixed Priority Scheduling Algorithm 3-1 Scheduling Algorithm Concepts 3-2 Modeling 3-3 Theorem & Proof: 3-4 Processor Utilization 3-5 Relaxing the Utilization Bound

1. Scheduling Algorithm Concepts: 3 A Fixed Priority Scheduling Algorithm 1. Scheduling Algorithm Concepts: 1) Deadline of a request for a task (point of time) the time of the next request for the same task; if t is the deadline of an unfulfilled request, => an overflow occurs at t; 2) Critical Instant for a task (point of time) is used to determine the algorithm; If t = critical instant, {a request for the task will have the largest response time;}

3) response time of a request for a task (duration) A Fixed Priority Scheduling Algorithm 3) response time of a request for a task (duration) the time span= [t(request), t(the end of the response to the request)] 4) Critical time zone for a task (duration) the time interval = [t(a critical instant), t(the end of the response to the corresponding request of the task)]

3 A Fixed Priority Scheduling Algorithm Obviously, the fixed one is a RMS algorithm. (Rate-Monotonic Scheduling)

1) Allocation of Priority: 3 A Fixed Priority Scheduling Algorithm 2. Modeling: 1) Allocation of Priority: Priority is inversely proportional to Period of request; 2) Schedulability Analysis CPU Utilization: U = sum(Ci/Ti); U<=1; Otherwise, the tasks can not be scheduled in the single processor system.

si is a period task and defined as si(Ti,Ci,Di); 3 A Fixed Priority Scheduling Algorithm 2. Modeling: 3) Defination: si is a period task and defined as si(Ti,Ci,Di); Ti is the Request_Period of si; = the reciprocal(the request rate) task with lower Request_Period will have higher Priority; task with higher Rquest_Rate will have higher Priority; Ci is the respective rum-times;(processor time spent) Di is the end of the request period;

The delay in the completion of si is the largest 3 A Fixed Priority Scheduling Algorithm 3. Theorem & Proof: 1)Theorem 1: A critical instant for any task occurs whenever the task is requested simultaneously with requests for all higher priority tasks. Proof: The delay in the completion of si is the largest when t2 coincide with t1;

3 A Fixed Priority Scheduling Algorithm Effect: I. One of the values of this result is that a simple direct calculation can determine whether or not a given Priority assignment will yield a feasible scheduling algorithm. If 1> it can schedule a set of tasks; 2> the requests for all tasks at their critical instants are fulfilled before their respective deadlines. => it is a feasible scheduling algorithm.

A Fixed Priority Scheduling Algorithm 3 A Fixed Priority Scheduling Algorithm T1=2, T2=5 C1=1, C2=1 (a) (T1 higher priority) Feasible (b) (T1 higher priority) C2 can be increased to 2 (c) (T2 higher priority) C1 and C2 can be at most 1

A Fixed Priority Scheduling Algorithm 3 A Fixed Priority Scheduling Algorithm Q: In figure2, for task 2, plz answer below items: deadline, critical instant, the end of respond end, response time, critical time zone? My understanding: as the critical time zone in Figure 2, for task2, the end of the response is 5, actually task2 is finished to response at 2. right? a new request can come at t=5, => 5 is deadline.

A Fixed Priority Scheduling Algorithm 3 A Fixed Priority Scheduling Algorithm A1, all the tasks have periodic requests, A4, run-times is constant. => otherwise, critical time zone can be defined as the time zone between its request and deadline, if the task has the highest priority.

3 A Fixed Priority Scheduling Algorithm Effect: II.Every fixed priority assignments rule can be scheduled by the RMPA(rate-monotonic priority assignment). Reason: Precondition is (T1==2) < (T2= 5); 1) Priority(S1) > Priority(S2); need to meet: (T2/T1)*C1 + C2 <= T2 Request_Rate(S1) > Request_Rate(S2); 2) Priority(S1) < Priority(S2); need to meet: C1 + C2 <= T1, Or: (T2/T1)*C1 + (T2/T1)*C2 <= (T2/T1)*T1 <= T2 => the algorithm is feasible for both of the two cases.

Effect: 3 A Fixed Priority Scheduling Algorithm => More generally, the rule of Priority assignment is to assign priority to tasks according to their Request_Rate, independent of their of their run-times(C1,C2); => task with higher Request_Rate will have a higher Priority. Or, task with lower Request_Period(T1,T2) will have a higher Priority.

Effect: 3 A Fixed Priority Scheduling Algorithm for(T1==2) < (T2= 5); => Request_Period(T1) < Request_Period(T2) => S1 has higher Request_Rate; => S1 has a higher Priority; The way to assign Priority to tasks is called: RMPA(Rate Monotonic Priority Assignment) The algorithm of RMPA is called: RMS(Rate-Monotonic Scheduling)

3 A Fixed Priority Scheduling Algorithm 3. Theorem & Proof: 2) Theorem 2: If a feasible priority assignment exists for some task set, the rate-monotonic priority is feasible for that task set. If a static scheduling algorithm exists for some task set, RMS is feasible for the task set.

3 A Fixed Priority Scheduling Algorithm Proof: Exchange Algorithm 1> Assumption: If a static scheduling algorithm, RMS1, exists for some task set; Sa,Sb is 2 tasks of adjacent priorities in the task set, and Priority(Sa)> Priority(Sb), But, Request_Period: Ta > Tb

3 A Fixed Priority Scheduling Algorithm 2> Proving process: Obviously, it differs with definition of RMS. In order to be in accord with RMS => Action: exchange the priorities of Sa,Sb; => the resultant priority assignment is still feasible. 3> Conclusion: RMPA can be obtained from any Priority ordering by a sequence of pairwise priority re-ordering.

3 A Fixed Priority Scheduling Algorithm 4> Significance: Advantage: RMS is proved as the optimum of static scheduling algorithm, more feasible, little overhead; Disadvantage: Processor Utilization is not high When n→∞, Processor utilization=ln2 ≈70%.

3 A Fixed Priority Scheduling Algorithm 5> Question? scenario: Priority Inversion in real-time system, resources are shared by real-time tasks, it may happens that a lower priority task will block the processing of a task with higher priority. => deadlock happens!!! => RMS cannot provide a proper schedule for the set of task. Any solution?

3 A Fixed Priority Scheduling Algorithm 6> Solution Control the time of priority inversion to be limited Based on requirements, it needs some protocol to ensure that.

3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 1) The least upper bound to PU in a fixed priority systems. PU factor: Ci increases, or Ti decreases, => U is improved. Note: Precondition is all tasks satisfy their deadlines at their Critical _Instant. U = S (Ci/Ti) T=request periods 1/T=frequency C=run-time

4. Processor Utilization 2) Significance 3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 2) Significance the least upper bound of UP factor is the minimum of the PU factors over all sets of tasks that fully utilize the processor. For all task sets whose PU factor is below this bound, there exists a fixed priority assignment which is feasible. For PU factor is above this bound can only be achieved if the of the tasks are suitably related.

4. Processor Utilization 2) Significance 3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 2) Significance The least upper bound to be determined is the infimum of the utilization factors corresponding to the RMPA over all possible Request_Period and run-times for the tasks. The least upper bound is firstly determined for two tasks, then extended for an arbitrary number of tasks.

4. Processor Utilization 3) Theorem 3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 3) Theorem 3 For a set of 2 tasks with fixed priority assignment, the least upper bound to the PU factor is U= 2(2(1/2)-1) Such as: if the Request_Period, Tb, for the lower Priority task is a multiple of the other task’s Request_Period, Ta. for U = 1- f(1-f)/(I+f), I=[Tb/Ta], f= {Tb/Ta} => when f = 0, PU factor: U=1

4. Processor Utilization 3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 4) Theorem 4 For a set of m tasks with fixed priority order, and the restriction that the ratio between any two Request_Period, Tb/Ta<2, the least upper bound to the PU factor is: U = m(2 1/m -1);

4. Processor Utilization 3 A Fixed Priority Scheduling Algorithm 4. Processor Utilization 5) Theorem 5 For a set of m tasks with fixed priority order, the least upper bound to PU is U = m(2 1/m -1); => to determine the least upper bound of the PU factor, we need only consider task sets in which the ratio between any two Request_Period,Tb/Ta, is less than 2

3 A Fixed Priority Scheduling Algorithm 5. Relaxing the Utilization Bound: Limitation: for real-time guaranteed service, the least upper bound can approach ln2 for large task sets. How to improve the situation? if f= {Tm/Ti}=0, for i=1,2,…,(m-1). But, it cannot always be done.

3 A Fixed Priority Scheduling Algorithm 5. Relaxing the Utilization Bound: alternative solution: 1. buffer the lower priority task, Sm, and perhaps several of the lower priority tasks. 2. relax their head deadlines. suppose: 1. the entire task set has a finite period 2. the buffered tasks are executed in some reasonable fashion.

3 A Fixed Priority Scheduling Algorithm 5. Relaxing the Utilization Bound: => Delay_Timem & amount of buffering required can be computed. => Dynamic fashion is a better solution, with PU factor 100%.

A Deadline Driven Scheduling Algorithm 4 A Deadline Driven Scheduling Algorithm 4-1 DDSA & Policy of Priority setting 4-2 Necessary and sufficient condition

Deadline Driven Scheduling Algorithm; 4 A Deadline Driven Scheduling Algorithm DDSA Deadline Driven Scheduling Algorithm; it is Dynamic Scheduling Algorithm called in the paper. Policy of Priority setting: Priority is assigned to a task according to the deadline of its current request.

Dynamic Scheduling Algorithm that means, 4 A Deadline Driven Scheduling Algorithm Dynamic Scheduling Algorithm that means, if the deadline of the task’s current request is the nearest, =>a task will be assigned the highest priority if the deadline of the task’s current request is the furthest, => a task will be assigned the lowest priority

4 A Deadline Driven Scheduling Algorithm 2. Necessary and sufficient condition for the feasibility of the algorithm. Theorem 6 When the DDSA is used to schedule a set of tasks on a single processor, there is no processor idle time prior to an overflow.

For a given set of tasks, the DDSA is feasible if and only if, 4 A Deadline Driven Scheduling Algorithm 2. Necessary and sufficient condition for the feasibility of the algorithm. Theorem 7 For a given set of tasks, the DDSA is feasible if and only if, (C1/T1) + (C2/T2) +…+ (Cm/Tm) <= 1 Judgment is rest on: if the total demand > the available processor time => it is not a feasible scheduling algorithm

A Mixed Scheduling Algorithm 5 A Mixed Scheduling Algorithm 5-1 Concept 5-2 Mathematical results Theorem & Proof: Processor Utilization

5 A Mixed Scheduling Algorithm 1. Concept MSA are combinations of RMSA and DDSA 2. Mathematical results: 1)Theorem 8 If a set of tasks are scheduled by the DDSA on a processor whose availability function is sublinear, then there is no processor idle period to an overflow.

5 A Mixed Scheduling Algorithm 2) Theorem 9 A necessary and sufficient condition for the feasibility of the DDSA with respect to a processor with availability function ak(t) is [t/Tk+1] Ck+1 + [t/Tk+2] Ck+2 +…+ [t/Tm] Cm<=ak(t) for all t’s which are multiples of Tk+1, or Tk+2,…, or Tm.

5 A Mixed Scheduling Algorithm Notes: ak(t) is a non-decreasing function of t. ak(t) is sublinear, if for all t and all T, a(T)<= a(t+T) – a(t) Significance: 100% utilization is not achievable universally by the MSA.

6 Algorithm Comparison 6-1 Advantages 6-2 Comparison

6 Algorithm Comparison Advantage: URMSA < UMSA < UDDSA The least upper bound is considerably less restrictive for the MSA than RMSA. URMSA is only slightly greater than the worst case of UMSA. => MSA is preferred.

6 Algorithm Comparison Comparison: Example: If T1=3, T2=4, T3=5, a1(20)=13, C1=1, C2=1, C3=2 Here we go: to prove MSA is prefferred.

6 Algorithm Comparison Based on the reasoning of Theorem 1, => C1+ C2+C3 <= T1 1 + 1+ C3 <=3 => C3max <= 1 => URMSA = 1/3+1/4+1/5=78.3%

6 Algorithm Comparison Based on Theorem 7, => C1/T1 + C2/T2 +C3/T3 <= 1 1/3 + 1/4+ C3/5 <=1 => C3max <= 25/12 ≈ 2.0833 => UDDSA = 1/3+1/4+2.0833/5 = 1/3+1/4+(25/12)/5 =100%

6 Algorithm Comparison Based on Theorem 9, => if k=1, then [t/T2]C2 + [t/T3]C3 <= a1(20) [20/4]*1 + [20/5]C3 <= 13 => C3max = 2 for U = C1/T1 +C2/T2 +C3/T3 => UMSA = 1/3+1/4+2/5=98.3%

7 Conclusion Problems associated with multiprogramming are focused in a hear-real-time environment typified by process control and monitoring, using some assumptions which characterize that application.

7 Conclusion 3. Conclusion for all fixed priority scheduling algorithm: which assigns priority to tasks in a monotonic relation to their Request_Rate was shown to be optimum among the class of all fixed priority scheduling algorithms. The least upper bound of PU factor is on the order of 70% for large task sets.

7 Conclusion 3. Conclusion Dynamic Deadline Driven Scheduling Algorithm: is shown to be globally optimum and capable of achieving 100%

7 Conclusion 3. Conclusion Mixed Scheduling Algorithm: appears to provide most of the benefits of the Deadline Driven Scheduling Algorithm, and yes may be readily implemented in existing computers.

Q & A