Lecture 6: Real-Time Scheduling

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

Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
EE5900 Advanced Embedded System For Smart Infrastructure
Chapter 7 - Resource Access Protocols (Critical Sections) Protocols: No Preemptions During Critical Sections Once a job enters a critical section, it cannot.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
© 2008 Wayne Wolf Overheads for Computers as Components 2 nd ed. Processes and operating systems zScheduling policies: yRMS; yEDF. zScheduling modeling.
CS5270 Lecture 31 Uppaal, and Scheduling, and Resource Access Protocols CS 5270 Lecture 3.
CPE555A: Real-Time Embedded Systems
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
Real-Time Scheduling CIS700 Insup Lee October 3, 2005 CIS 700.
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:
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.
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
Problem 11: Complex Hierarchical Scheduling Full Processor FP T3T2 T4T1 EDF T6T5 RM T10T9T8T7 EDFSPS DPS 10 Tasks - with jitter - with bursts - deadline.
Courseware Scheduling Uniprocessor Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
Project 2 – solution code
Periodic Task Scheduling
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
EE 249, Fall Discussion: Scheduling Haibo Zeng Amit Mahajan.
Embedded Systems Exercise 3: Scheduling Real-Time Periodic and Mixed Task Sets 18. May 2005 Alexander Maxiaguine.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
CprE 458/558: Real-Time Systems
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.
Technische Universität Dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2007/12/14.
Module 2 Clock-Driven Scheduling
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
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.
Real-Time Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
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.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
6. Application mapping 6.1 Problem definition
Real Time Systems Real-Time Schedulability Part I.
RTOS task scheduling models
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.
Special Class on Real-Time Systems
CSE 522 Real-Time Scheduling (2)
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.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
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.
CS333 Intro to Operating Systems Jonathan Walpole.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
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.
Embedded System Scheduling
Scheduling and Resource Access Protocols: Basic Aspects
Wayne Wolf Dept. of EE Princeton University
Lecture 24: Process Scheduling Examples and for Real-time Systems
Realtime Scheduling Algorithms
Real Time Scheduling Mrs. K.M. Sanghavi.
CSCI1600: Embedded and Real Time Software
COT 4600 Operating Systems Spring 2011
Limited-Preemption Scheduling of Sporadic Tasks Systems
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:

Lecture 6: Real-Time Scheduling Advanced Operating System Fall 2012

Real-Time Scheduling A real-time task is defined to be one in which there is a hard deadline to meet; failure to meet the deadline can lead to disaster. Example of real-time task include process control such as a nuclear reactor, automatic flight control, etc. Real-time tasks can be classified as periodic or aperiodic. Periodic: the processes are considered to be periodic if they require CPU at constant intervals (periods). Each periodic process has a fixed processing time ei once it acquires the CPU, a deadline di when it must be serviced by the CPU, and a period pi. The relationship of the processing time, the deadline and the period can be expressed as 0≤ei ≤di ≤pi. The rate of a periodic task is 1/pi. Aperiodic tasks are tasks that come in at random times. However, when it makes a request, it is guaranteed that it will not make a request until some time p later.

Real-Time CPU Scheduling Periodic: the processes are considered to be periodic if they require CPU at constant intervals (periods). Each periodic process has a fixed processing time ei once it acquires the CPU, a deadline di when it must be serviced by the CPU, and a period pi. The relationship of the processing time, the deadline and the period can be expressed as 0≤ei ≤di ≤pi. The rate of a periodic task is 1/pi.

Aperiodic tasks Aperiodic tasks are tasks that come in at random times. However, when it makes a request, it is guaranteed that it will not make a request until some time p later.

Rate-Monotonic Scheduling The rate-monotonic scheduling algorithm schedules periodic tasks using a static priority policy with preemption. If a lower-priority process is running and a higher-priority process becomes available to run, it will preempt the lower-priority process. For each process, its priority=1/pi(inverse of the period). The rationale behind this policy is to assign a higher priority to tasks that require the CPU more often. Assumption: the processing time of a periodic process is the same for each CPU burst. Severe constraints: processes must be periodic, independent and have deadline equal to period. All processes have an initial release at time 0.

Rate-Monotonic Scheduling: example Ti si di pi ei T1 2 3 1 T2 4 1.2 T3 0.3 Si: initial start time di: relative deadline pi: period i ei: maximum execution time Priority: T1: 1/3; T2: ¼; T3: ¼; T1: 0, 3, 6, 9, 12, … T2: 1, 5, 9, 13, … T3: 0, 4, 8, 12, … T1 T2 T3 /// 1 2.2 2.5 3.0 4.0 4.3 5.0 6.0 7.0 7.2 8.0 8.3 9.0 10 11.2 12 …

Rate-Monotonic Scheduling Rate-Monotonic scheduling algorithm is considered optimal in the sense that if a set of processes cannot be scheduled by this algorithm, it cannot be scheduled by any other algorithm that assigns static priorities. Despite being optimal, then rate-monotonic scheduling has a limitation: CPU utilization is bounded, and it is not always possible to fully maximize CPU resources. The worst-case CPU utilization for scheduling N processes is As the number of processes approaches infinity, CPU utilization falls approximately 69%. Feasibility test: Two processes: CPU utilization is bounded about 83%. Sufficient condition: If there are two processes to be scheduled and the combined CPU utilization is less than 83%, then the Rate-Monotonic scheduling algorithm is guaranteed to schedule them so that they can meet their deadline. Otherwise, it is inclusive. The above condition is not necessary condition: Example Task 1: Execution time: 2, Period: 4; Task 2: Execution time: 4, Period: 8. Can be scheduled by DM scheduling algorithm, CPU utilization is 100%.

Earliest-Deadline-First Scheduling (EDF) Earliest-Deadline-First scheduling dynamically assigns priorities according to deadline. The earliest the deadline, the higher the priority. Algorithm: At each moment of time t, schedule the task whose deadline is closest to t. Ties can be resolved arbitrarily. EDF scheduling does not require that processes be periodic, nor must a process require a constant amount of CPU time per burst. The only requirement is that a process announce its deadline to the scheduler when it becomes runnable. EDF scheduling is theoretically optimal – theoretically, it can schedule processes so that each process can meet its deadline requirements and CPU utilization will be 100 percent. In practice, however, it is impossible to achieve this level of CPU utilization due to the cost of context switching between processes and interrupt handling.

Earliest-Deadline-First Scheduling (EDF): Example Ti di pi ei T1 2 3 1 T2 4 1.2 T3 0.3 T1 makes a request at some unpredictable time. But if it makes a request at time t, then it is guaranteed that it will not make a request again at time t+3. The current request is expected to complete at time t+2, and it will take 1 time unit to finish. T1: 0, 3, 6, 9, 12, … T2: 1, 5, 9, 13, … T3: 0, 4, 8, 12, … T1 T2 T3 /// 1 2.2 2.5 3.0 4.0 4.3 5.0 6.0 7.0 7.2 8.0 8.3 9.0 10 11.2 12 …

Example: Ti si di pi ei T1 50 25 T2 80 35 50 25 T2 80 35 Rate-monotonic scheduling: misses deadlines Earliest-Deadline-First scheduling:

Feasibility Test for EDF alg.: Necessary condition: is a necessary (but not sufficient condition) for a feasible schedule. Example: Since we can have feasible schedule for the above example, this condition holds. Sufficient condition: is a sufficient (but not necessary condition) for a feasible schedule. Example: Since in the above example, we have: ½+1.2/3+ 0.3/4=0.5+0.4+0.075=0.975, sufficient condition holds, so we are sure that there exists feasible schedule. If it satisfies necessary condition, but fails sufficient condition, we cannot be sure. However, there is a procedure to determine. Too complicated to explain.

Feasibility Test for EDF alg.: We can always test the feasibility by constructing a schedule using EDF algorithm from 0 until some time T and check if all deadlines within [0, T] are met and certain condition satisfied. Two cases: Suppose si=sj=0 for any i and j, run EDF alg from 0 to T=LCM{p1, p2, …, pn}, if all deadlines are met, then feasible; otherwise, not feasible. Suppose si≠sj for any i and j, construct a schedule from time 0 until time t2=S+2T, where S=max{s1, s2, …, sn}, and T=LCM{p1,p2,…, pn}, if all deadlines in [0, t2] are met, then feasible; otherwise, not feasible.

Deadline-Monotonic Algorithm (DM) Working for both periodic tasks and Aperiodic tasks. Fixed-priority Uses relative deadlines: the shorter the relative deadline, the higher the priority RM and DM are identical if the relative deadline is proportional to its period Otherwise DM performs better in the sense that it can sometimes produce a feasible schedule when RM fails, while RM always fails when DM fails Feasibility Test: T = {T1, T2, ..., Tn}, ordered by priority (i < j, i < j) Sufficient condition: for any i: 1≤i ≤n,

DM example t1 : e1 = 2, d1 = 3, p1 = 5 t2 : e2 = 2, d2 = 6, p2 = 15

Reference Leung, J. Y-T. and J. Whitehead, "On the Complexity of Fixed-Priority Scheduling of Periodic, Real-Time Tasks," Performance Evaluation, 2:237-250, 1982. Also in Proc. of the 18th Annual Allerton Conference on Communication, Control, and Computing, 464-470, Urbana-Champaign, IL, 1980. Leung, J. Y-T. and M. L. Merrill, "A Note on Preemptive Scheduling of Periodic, Real-Time Tasks," Information Processing Letters, 11:115-118, 1980.

End of lecture 6 Thank you!