Embedded System Scheduling

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.
EE5900 Advanced Embedded System For Smart Infrastructure
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
CPE555A: Real-Time Embedded Systems
Real Time Scheduling Terminologies define Fixed Priority Scheduler
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
CPU SCHEDULING RONG ZHENG. OVERVIEW Why scheduling? Non-preemptive vs Preemptive policies FCFS, SJF, Round robin, multilevel queues with feedback, guaranteed.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
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.
Distributed Real-Time systems 1 By: Mahdi Sadeghizadeh Website: Sadeghizadeh.ir Advanced Computer Networks.
More Scheduling cs550 Operating Systems David Monismith.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Real-Time Systems Lecture 1: Introduction. Course Outline Design Methodologies Scheduling Theory  Schedulability Analysis  Real-Time Scheduling Algorithms.
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
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 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
RTOS task scheduling models
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
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
Introduction to Real-Time Systems
For a good summary, visit:
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
Real-Time Operating Systems RTOS For Embedded systems.
REAL-TIME OPERATING SYSTEMS
OPERATING SYSTEMS CS 3502 Fall 2017
CPU SCHEDULING.
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Wayne Wolf Dept. of EE Princeton University
EEE 6494 Embedded Systems Design
Real Time Operating Systems for Networked Embedded Systems
Chapter 8 – Processor Scheduling
Real Time Operating System
Real-time Software Design
Lecture 24: Process Scheduling Examples and for Real-time Systems
CprE 458/558: Real-Time Systems
Realtime Scheduling Algorithms
Real Time Scheduling Mrs. K.M. Sanghavi.
Embedded Systems Introduction to Real-Time Systems
CSCI1600: Embedded and Real Time Software
COT 4600 Operating Systems Spring 2011
CSCI1600: Embedded and Real Time Software
Enforcing Real-Time Behavior I
Clock-driven Static scheduling
CSCI1600: Embedded and Real Time Software
Processes and operating systems
Operating Systems Real-Time Operating Systems
Real-Time Process Scheduling Concepts, Design and Implementations
CHAPTER 3 A Reference Model of Real-Time Systems
Chapter 6: CPU Scheduling
Ch 4. Periodic Task Scheduling
Real-Time Process Scheduling Concepts, Design and Implementations
Real-Time Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

Embedded System Scheduling

Real-Time Systems (from Dr. Chalermek Intanagonwiwat) Result in severe consequences if logical and timing correctness are not met Two types exist Soft real-time Tasks are performed as fast as possible Late completion of jobs is undesirable but not fatal. System performance degrades as more & more jobs miss deadlines Example: Online Databases

Real-Time Systems (cont.) (from Dr. Chalermek Intanagonwiwat) Hard real-time Tasks have to be performed on time Failure to meet deadlines is fatal Example : Flight Control System Qualitative Definition

Hard and Soft Real Time Systems (Operational Definition) (from Dr Hard and Soft Real Time Systems (Operational Definition) (from Dr. Chalermek Intanagonwiwat) Hard Real Time System Validation by provably correct procedures or extensive simulation that the system always meets the timings constraints Soft Real Time System Demonstration of jobs meeting some statistical constraints suffices. Example – Multimedia System 25 frames per second on an average

Embedded & Real-Time Systems Execute tasks correctly and IN time. Systems with multiple tasks need scheduling

Definitions Ready time r – task available Schedule Completed C Deadline D From C.W. Mercer

Ready time Clock External interrupt Software e.g. branch

Terms Periodic – aperiodic Fixed – variable computation time Predictable – unpredictable Preemptible – non preemptible Task  overall activity Jobs  individual computation

Terminologies (from J. A. Stankovic) Job Each unit of work that is scheduled and executed by the system Task A set of related jobs For example, a periodic task Ti consists of jobs J1, J2, J3, … coming at every period Release time Time instant at which a job becomes available for execution It can be executed at any time at or after the release time Deadline Time instant by which a job should be finished Relative deadline: Maximum allowable response time Absolute deadline = release time + relative deadline Real-time computing 2017-10-17

Terminologies (from J. A. Stankovic) Periodic task Ti Period Pi Worst case execution time Ci Relative deadline Di Job Jik Absolute deadline = release time + relative deadline Response time = finish time – release time Deadline miss if Finish time > absolute deadline Response time of Jik > Di Real-time computing 2017-10-17

Real-Time Workload (from Insup Lee) Job (unit of work) a computation, a file read, a message transmission, etc Attributes Resources required to make progress Timing parameters Absolute deadline Released Execution time Relative deadline

Real-Time Task (from Insup Lee) Task : a sequence of similar jobs Periodic task (p,e) Its jobs repeat regularly Period p = inter-release time (0 < p) Execution time e = maximum execution time (0 < e < p) Utilization U = e/p 5 10 15

Periodic-Aperiodic Tasks From C.W. Mercer

Aperiodic Non-predictable Task From C.W. Mercer

Preemptible&non-preemptible Tasks From C.W. Mercer

Commonly use real-time scheduling Clock-driven Weighted round-robin Priority driven

Scheduling Algorithms in RTOS (cont. ) (from Dr Scheduling Algorithms in RTOS (cont.) (from Dr. Chalermek Intanagonwiwat) Clock Driven All parameters about jobs (execution time/deadline) known in advance. Schedule can be computed offline or at some regular time instances. Minimal runtime overhead. Not suitable for many applications.

Scheduling Algorithms in RTOS (cont. ) (from Dr Scheduling Algorithms in RTOS (cont.) (from Dr. Chalermek Intanagonwiwat) Weighted Round Robin Jobs scheduled in FIFO manner Time quantum given to jobs is proportional to it’s weight Example use : High speed switching network QOS guarantee. Not suitable for precedence constrained jobs. Job A can run only after Job B. No point in giving time quantum to Job B before Job A.

Example task set From C.W. Mercer

First in First out (FIFO) From C.W. Mercer

Round Robin scheduling From C.W. Mercer

Cyclic executive From C.W. Mercer

Cyclic executive From C.W. Mercer

Cyclic executive modified From C.W. Mercer

Scheduling Algorithms in RTOS (cont. ) (from Dr Scheduling Algorithms in RTOS (cont.) (from Dr. Chalermek Intanagonwiwat) Priority Scheduling Processor never left idle when there are ready tasks Processor allocated to processes according to priorities Priorities Static - at design time Dynamic - at runtime

Priority Scheduling (from Dr. Chalermek Intanagonwiwat) Earliest Deadline First (EDF) Process with earliest deadline given highest priority Least Slack Time First (LSF) slack = relative deadline – execution left Rate Monotonic Scheduling (RMS) For periodic tasks Tasks priority inversely proportional to it’s period

Schedulability (from Insup Lee) Property indicating whether a real-time system (a set of real-time tasks) can meet their deadlines (4,1) (5,2) (7,2)

Real-Time Scheduling (from Insup Lee) Determines the order of real-time task executions Static-priority scheduling Dynamic-priority scheduling (4,1) (5,2) 5 10 15 (7,2)

RM (Rate Monotonic) (from Insup Lee) Optimal static-priority scheduling It assigns priority according to period A task with a shorter period has a higher priority Executes a job with the shortest period T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

RM (Rate Monotonic) (from Insup Lee) Executes a job with the shortest period T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

RM (Rate Monotonic) (from Insup Lee) Executes a job with the shortest period Deadline Miss ! T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

Response Time (from Insup Lee) Duration from released time to finish time T1 (4,1) T2 (5,2) 5 10 15 T3 (10,2)

Response Time (from Insup Lee) Duration from released time to finish time Response Time T1 (4,1) T2 (5,2) 5 10 15 T3 (10,2)

Response Time (from Insup Lee) Response Time (ri) [Audsley et al., 1993 HP(Ti) : a set of higher-priority tasks than Ti T1 (4,1) T2 (5,2) 5 10 T3 (10,2) 5 10

RM - Schedulability Analysis (from Insup Lee) Real-time system is schedulable under RM if and only if ri ≤ pi for all task Ti(pi,ei) Joseph & Pandya, “Finding response times in a real-time system”, The Computer Journal, 1986.

RM – Utilization Bound (from Insup Lee) Real-time system is schedulable under RM if ∑Ui ≤ n (21/n-1) Liu & Layland, “Scheduling algorithms for multi-programming in a hard-real-time environment”, Journal of ACM, 1973.

RM – Utilization Bound (from Insup Lee) Real-time system is schedulable under RM if ∑Ui ≤ n (21/n-1) Example: T1(4,1), T2(5,1), T3(10,1), ∑Ui = 1/4 + 1/5 + 1/10 = 0.55 3 (21/3-1) ≈ 0.78 Thus, {T1, T2, T3} is schedulable under RM.

RM – Utilization Bound (from Insup Lee) Real-time system is schedulable under RM if ∑Ui ≤ n (21/n-1)

Rate monotonic schedulable bound From C.W. Mercer

EDF (Earliest Deadline First) (from Insup Lee) Optimal dynamic priority scheduling A task with a shorter deadline has a higher priority Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF (Earliest Deadline First) (from Insup Lee) Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF (Earliest Deadline First) (from Insup Lee) Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF (Earliest Deadline First) (from Insup Lee) Executes a job with the earliest deadline T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF (Earliest Deadline First) (from Insup Lee) Optimal scheduling algorithm if there is a schedule for a set of real-time tasks, EDF can schedule it. T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

Processor Demand Bound (from Insup Lee) Demand Bound Function : dbf(t) the maximum processor demand by workload over any interval of length t t T1 (4,1) T2 (5,2) 5 10 15 T3 (7,2)

EDF - Schedulability Analysis (from Insup Lee) Real-time system is schedulable under EDF if and only if dbf(t) ≤ t for all interval t Baruah et al. “Algorithms and complexity concerning the preemptive scheduling of periodic, real-time tasks on one processor”, Journal of Real-Time Systems, 1990. Demand Bound Function : dbf(t) the maximum processor demand by workload over any interval of length t

EDF – Utilization Bound (from Insup Lee) Real-time system is schedulable under EDF if and only if ∑Ui ≤ 1 Liu & Layland, “Scheduling algorithms for multi-programming in a hard-real-time environment”, Journal of ACM, 1973.

EDF – Overload Conditions (from Insup Lee) Domino effect during overload conditions Example: T1(4,3), T2(5,3), T3(6,3), T4(7,3) Deadline Miss ! T1 T2 T3 T4 3 5 6 7 Better schedules : T1 5 7 T3 3 6 T1 5 7 T4 3 6

Least Slack Time First (LSF) slack = relative deadline – execution left