Special Class on Real-Time Systems

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.
Real Time Scheduling.
EE5900 Advanced Embedded System For Smart Infrastructure
Introduction to Embedded Systems Resource Management - III Lecture 19.
Real-Time Mutli-core Scheduling Moris Behnam. Introduction Single processor scheduling – E.g., t 1 (P=10,C=5), t 2 (10, 6) – U= >1 – Use a faster.
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
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
An Introduction to Real Time Systems
Mehdi Kargahi School of ECE University of Tehran
DP-F AIR : A Simple Model for Understanding Optimal Multiprocessor Scheduling Greg Levin † Shelby Funk ‡ Caitlin Sadowski † Ian Pye † Scott Brandt † †
RUN: Optimal Multiprocessor Real-Time Scheduling via Reduction to Uniprocessor Paul Regnier † George Lima † Ernesto Massa † Greg Levin ‡ Scott Brandt ‡
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:
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
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
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.
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.
Fair Scheduling of Real-Time Tasks on Multiprocessors Uday Prabhala.
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.
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 Systems Mark Stanovich. Introduction System with timing constraints (e.g., deadlines) What makes a real-time system different? – Meeting timing.
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.
6. Application mapping 6.1 Problem definition
- 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.
Advanced Operating Systems - Spring 2009 Lecture 14 – February 25, 2009 Dan C. Marinescu Office: HEC 439 B. Office.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
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
Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2012 年 12 月 19 日 These slides use Microsoft clip.
Introduction to Real-Time Systems
CS333 Intro to Operating Systems Jonathan Walpole.
Operating System Concepts and Techniques Lecture 6 Scheduling-2* M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
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
REAL-TIME OPERATING SYSTEMS
Chapter 19: Real-Time Systems
Lecture 12: Real-Time Scheduling
EEE 6494 Embedded Systems Design
Lecture 24: Process Scheduling Examples and for Real-time Systems
CprE 458/558: Real-Time Systems
Real Time Scheduling Mrs. K.M. Sanghavi.
CSCI1600: Embedded and Real Time Software
Chapter 19: Real-Time Systems
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Ch.7 Scheduling Aperiodic and Sporadic Jobs in Priority-Driven Systems
Real-Time Process Scheduling Concepts, Design and Implementations
Ch 4. Periodic Task Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Presentation transcript:

Special Class on Real-Time Systems

Real-time vs. general operating system In addition to requiring logical correctness, real-time systems require temporal correctness Logical correctness: Given an input, the system must create the correct output Temporal correctness: The correct output must be created at the correct time

Real-time applications Real-time systems are used in a variety of applications Safety critical systems Airplane autopilot, power plant controllers Expensive systems Satellite controllers, Mars rovers Other time critical applications Radar system, Sensor networks Consumer and embedded devices Cell phones

Aspects of real-time research There are many active areas of research real-time systems Scheduling algorithms Schedulability tests Strategies for reducing power consumption Real-time operating systems Real-time programming languages Specific real-time applications Hardware for real-time systems

Standard real-time system model Periodic tasks: A mechanism for executing a job repeatedly at regular time intervals Example: Taking the temperature and initiating appropriate response in a power plant controller T = (e,p) e = execution requirement p = period

Example T = (3,5) This task generates a new job every 5 time units Each job will require at most 3 time units to execute The deadline of each job is equal to the arrival time of the next job

Task utilization Given a periodic task T = (e,p), the utilization of T is e/p Proportion of processing time this task will require on average Many schedulability tests are based on task utilization

Two common scheduling algorithms Earliest Deadline First (EDF) Jobs with earlier deadlines are given higher priority Rate Monotonic (RM) Jobs generated by tasks with shorter periods are given higher priority

Example RM and EDF schedules Three tasks, T1 = (0.5,3), T2 = (1,4), T3 = (2,6) T3 T2 T1 RM EDF EDF will meet all deadlines if it is possible to do so We say EDF is optimal on uniprocessors

Utilization-based EDF test Given a set of periodic tasks τ = {T1 =(e1,p1), T2=(e2,p2), …, Tn=(en,pn)} Let U = Σ ei/pi be the total utilization of τ If U ≤ 1, then τ can be successfully scheduled using preemptive EDF No jobs will miss their deadlines

Utilization-based RM test Given a set of periodic tasks τ = {T1 =(e1,p1), T2=(e2,p2), …, Tn=(en,pn)} Let U = Σ ei/pi be the total utilization of τ If U ≤ ln 2 (≈ 0.69), then τ can be successfully scheduled using preemptive RM Why use RM? Many real-time operating systems can only schedule tasks with fixed priority All jobs generated by the same task must have the same priority

Shortcomings of periodic task model The periodic tasks are assumed to all start at the same time We can easily add an offset to the task description T = (o,e,p) Not all tasks can have the job’s deadline equal to the task’s period We can easily add a deadline to the task description T = (o,e,p,d)

More serious shortcomings The model provided assumes all tasks are independent Jobs may share resources In this case, one job may block another job One job may generate data that will be used by another job In this case, we would want to impose a precedence constraint on these jobs

Scheduling jobs with dependiencies Both blocking and precedence constraints can cause priority inversion and timing anomolies Priority inversion: A higher priority job may be forced to wait while a lower priority job executes Timing anomolies: Reducing the execution of one job may cause another job finish execution at a later time

Priority inversion J1 J2 J3 = access of single-unit resource R 2 4 6 8 2 4 6 8 10 12 14 16 18 = access of single-unit resource R

Timing anomalies When tasks share resources, there may be timing anomalies. Example: Reducing J3’s critical section from 4 time units to 2.5 causes J1 to miss its deadline! J1 J2 J3 2 4 6 8 10 12 14 16 18

Multiprocessor Scheduling Scheduling analysis is much more difficult on multiprocessors Many tests can only guarantee feasibility when the utilization is approximately m/2, where m is the number of processors Things get even more complicated when there is resource sharing or precedence constraints

Multiprocessor Scheduling Hong and Leung used the following example to prove that no online scheduling algorithm can be optimal J1 = J2 = (0; 2; 4); J3 = (0; 4; 8) Later arrival times as follows J4 = J5 = (2; 2; 4), and J4 = J 5 = (4; 4; 8).

Example Part 1 J1 = J2 = (0, 2, 4); J3 = (0, 4, 8) Later arrival times as follows J4 = J5 = (2, 2, 4), and J4‘ = J 5‘ = (4, 4, 8). J3 cannot execute in interval [0,2] J1 J2 J3 J4 J5 2 4 6 8 10 12 14 16 18

Example Part 2 J1 = J2 = (0, 2, 4); J3 = (0, 4, 8) Later arrival times as follows J4 = J5 = (2, 2, 4), and J4‘ = J 5‘ = (4, 4, 8). J3 must execute in interval [0,2] J1 J2 J3 J4 J5 2 4 6 8 10 12 14 16 18

Multiprocessor Scheduling of PTs There are optimal online algorithms for scheduling periodic tasks on multiprocessors Pfair, LLREF, DP-Wrap These tasks make decisions to emulate the ideal schedule

Ideal (but impractical) schedule Ideally, we would execute all tasks at a constant rate Example T1 = (2,4), T2 = (3,6), and T3 = (6,8) Proportion Processor per Task T1 Remaining Execution T3 T2 T1 2 2 1 4 8 12 Unfortunately, there are only 2 processors and each can execute only one task at a time!

Optimal Algorithms for Multiprocs All the optimal scheduling algorithms tracks the ideal schedule Tasks are guaranteed to have executed at ideal rate whenever they have a deadline Hence, all deadlines are met! 2 1 4 8 12 T1 Remaining Execution Actual and Ideal CSCI 8740

DP-Fair Scheduling A global scheduling algorithm for periodic tasks with deadlines equal to periods The global scheduler executes whenever a job arrives / a deadline occurs The intervals between scheduling events is called a time slice At the beginning of each slice of length L, the scheduler allocates uiL units of execution to each task Ti Every DP-Fair Scheduling algorithm must adhere to 3 “don’t be stupid” rules

Don’t Be Stupid Rules Rule 1: Execute any job with zero laxity Execute right away if at risk of missing a deadline Rule 2: Don’t execute any job with zero remaining execution time Don’t execute if execution time is completed Rule 3: Do not allow processors to idle for more than L(m – U) time units Do not idle more than system slack allows

DP-Wrap: A Simple DP-Fair Alg T1=(7,2), T2= (10,3), T3= (9,4), T4 = (12,7), T5 = (14,5) First time slice is [0,7) Execution times are 2, 2.1, 3.1, 4.1 and 2.5, resp. T3 T2 T1 T3 T4 T5 T2 T1 T4 T5

Extensions to the DP-Fair Rules DP-Fair can also be used with sporadic tasks and tasks with deadlines not equal to periods If deadlines are ≥ periods, DP-Fair algorithms are still optimal If deadlines are < periods optimality no longer holds

Other types of real-time systems Soft real-time systems Deadlines may be missed Mixed real-time and non-real-time sytems Real-time and non-real-time jobs executing in the same system Want non-real-time jobs to complete as early as possible without causing real-time jobs to miss deadlines

Why I like researching real-time systems Analyzing real-time systems is like solving puzzles Analysis is visual Small changes in assumptions can have large impact in analysis