Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

Similar documents
Embedded Systems 14. Overview of embedded systems design

CIS 4930/6930: Principles of Cyber-Physical Systems

Embedded Systems - FS 2018

Aperiodic Task Scheduling

Real-Time Systems. Event-Driven Scheduling

Real-Time Systems. Lecture 4. Scheduling basics. Task scheduling - basic taxonomy Basic scheduling techniques Static cyclic scheduling

Task Models and Scheduling

Networked Embedded Systems WS 2016/17

Andrew Morton University of Waterloo Canada

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013

Real-Time Systems. Event-Driven Scheduling

Embedded Systems Development

There are three priority driven approaches that we will look at

Real-Time and Embedded Systems (M) Lecture 5

RUN-TIME EFFICIENT FEASIBILITY ANALYSIS OF UNI-PROCESSOR SYSTEMS WITH STATIC PRIORITIES

Real-time Scheduling of Periodic Tasks (2) Advanced Operating Systems Lecture 3

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #7: More on Uniprocessor Scheduling

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

3. Scheduling issues. Common approaches 3. Common approaches 1. Preemption vs. non preemption. Common approaches 2. Further definitions

Scheduling Lecture 1: Scheduling on One Machine

EDF Feasibility and Hardware Accelerators

Real-Time Scheduling

Bounding the End-to-End Response Times of Tasks in a Distributed. Real-Time System Using the Direct Synchronization Protocol.

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Clock-driven scheduling

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

Exam Spring Embedded Systems. Prof. L. Thiele

EDF Scheduling. Giuseppe Lipari May 11, Scuola Superiore Sant Anna Pisa

Priority-driven Scheduling of Periodic Tasks (1) Advanced Operating Systems (M) Lecture 4

Real-time Systems: Scheduling Periodic Tasks

Real-Time Scheduling and Resource Management

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Scheduling Lecture 1: Scheduling on One Machine

EDF Scheduling. Giuseppe Lipari CRIStAL - Université de Lille 1. October 4, 2015

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

On-line scheduling of periodic tasks in RT OS

EDF and RM Multiprocessor Scheduling Algorithms: Survey and Performance Evaluation

A Theory of Rate-Based Execution. A Theory of Rate-Based Execution

Real-time scheduling of sporadic task systems when the number of distinct task types is small

Multiprocessor Scheduling of Age Constraint Processes

Algorithm Design. Scheduling Algorithms. Part 2. Parallel machines. Open-shop Scheduling. Job-shop Scheduling.

Real-Time Systems. LS 12, TU Dortmund

Non-Work-Conserving Non-Preemptive Scheduling: Motivations, Challenges, and Potential Solutions

CPU SCHEDULING RONG ZHENG

Schedulability analysis of global Deadline-Monotonic scheduling

Task assignment in heterogeneous multiprocessor platforms

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

Static priority scheduling

Rate-monotonic scheduling on uniform multiprocessors

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

Tardiness Bounds under Global EDF Scheduling on a Multiprocessor

Deadline-driven scheduling

Tardiness Bounds under Global EDF Scheduling on a. Multiprocessor

Lecture 4 Scheduling 1

Bounding the Maximum Length of Non-Preemptive Regions Under Fixed Priority Scheduling

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas January 24, 2014

Static-Priority Scheduling. CSCE 990: Real-Time Systems. Steve Goddard. Static-priority Scheduling

Two Processor Scheduling with Real Release Times and Deadlines

Polynomially solvable and NP-hard special cases for scheduling with heads and tails

End-to-End Scheduling to Meet Deadlines in Distributed Systems

A New Sufficient Feasibility Test for Asynchronous Real-Time Periodic Task Sets

An Improved Schedulability Test for Uniprocessor. Periodic Task Systems

Multi-core Real-Time Scheduling for Generalized Parallel Task Models

Real-Time Scheduling. Real Time Operating Systems and Middleware. Luca Abeni

AS computer hardware technology advances, both

On Machine Dependency in Shop Scheduling

Non-preemptive multiprocessor scheduling of strict periodic systems with precedence constraints

Multiprocessor Scheduling II: Global Scheduling. LS 12, TU Dortmund

Segment-Fixed Priority Scheduling for Self-Suspending Real-Time Tasks

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

Improved Priority Assignment for the Abort-and-Restart (AR) Model

Uniprocessor real-time scheduling

Rate Monotonic Analysis (RMA)

arxiv: v1 [cs.os] 21 May 2008

The Partitioned Dynamic-priority Scheduling of Sporadic Task Systems

CSE 380 Computer Operating Systems

TDDI04, K. Arvidsson, IDA, Linköpings universitet CPU Scheduling. Overview: CPU Scheduling. [SGG7] Chapter 5. Basic Concepts.

Schedulability and Optimization Analysis for Non-Preemptive Static Priority Scheduling Based on Task Utilization and Blocking Factors

On the Soft Real-Time Optimality of Global EDF on Multiprocessors: From Identical to Uniform Heterogeneous

Approximation Algorithms for scheduling

CPU scheduling. CPU Scheduling

Mitra Nasri* Morteza Mohaqeqi Gerhard Fohler

Exact speedup factors and sub-optimality for non-preemptive scheduling

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas February 11, 2014

Multi-core Real-Time Scheduling for Generalized Parallel Task Models

Non-preemptive Scheduling of Distance Constrained Tasks Subject to Minimizing Processor Load

IN4343 Real Time Systems April 9th 2014, from 9:00 to 12:00

Spare CASH: Reclaiming Holes to Minimize Aperiodic Response Times in a Firm Real-Time Environment

Probabilistic Preemption Control using Frequency Scaling for Sporadic Real-time Tasks

Exploiting Precedence Relations in the Schedulability Analysis of Distributed Real-Time Systems

Resource Sharing in an Enhanced Rate-Based Execution Model

Laxity Release Optimization for Simulink Models

Dynamic-Priority Scheduling. CSCE 990: Real-Time Systems. Steve Goddard. Dynamic-priority Scheduling

A Utilization Bound for Aperiodic Tasks and Priority Driven Scheduling

Predictability of Least Laxity First Scheduling Algorithm on Multiprocessor Real-Time Systems

Transcription:

Embedded Systems 15-1 - REVIEW: Aperiodic scheduling C i J i 0 a i s i f i d i Given: A set of non-periodic tasks {J 1,, J n } with arrival times a i, deadlines d i, computation times C i precedence constraints resource constraints Class of scheduling algorithm: Preemptive, non-preemptive Off-line / on-line Optimal / heuristic One processor / multi-processor Cost function: Minimize maximum lateness Find: Feasible schedule Optimal schedule according to given cost function - 2-1

REVIEW: EDD Earliest Due Date EDD: execute the tasks in order of non-decreasing deadlines Lemma: If arrival times are synchronous, then preemption does not help, i.e. if there is a preemptive schedule with maximum lateness L max, then there is also a non-preemptive schedule with maximum lateness L max. Theorem (Jackson 55): Given a set of n independent tasks with synchronous arrival times, any algorithm that executes the tasks in order of non-decreasing deadlines is optimal with respect to minimizing the maximum lateness. - 3 - REVIEW: EDF Earliest Deadline First EDF: At every instant execute the task with the earliest absolute deadline among all the ready tasks. Theorem (Horn 74): Given a set of n independent task with arbitrary arrival times, any algorithm that at every instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness. - 4-2

REVIEW: Non-preemptive version Theorem (Jeffay et al. 91): EDF is an optimal non-idle scheduling algorithm also in a non-preemptive task model. Non-preemptive scheduling with idle schedules allowed is NP-hard Possible approaches: Heuristics Bratley s algorithm: Branch-and-bound - 5 - REVIEW: Scheduling with precedence constraints Non-preemptive scheduling with non-synchronous arrival times, deadlines and precedence constraints is NP-hard. LDF for synchronous arrival times (all tasks arrive at 0) - 6-3

REVIEW: LDF Latest Deadline First J 1 2 J 2 5 J 3 4 3 J 4 J 5 5 J 6 6 d 1 d 4 d 3 d 5 d 2 d 6 0 1 2 3 4 5 6 7 t - 7 - LDF Theorem (Lawler 73): LDF is optimal wrt. maximum lateness. - 8-4

- 9 - Preemptive Non-preemptive scheduling with non-synchronous arrival times, deadlines and precedence constraints is NP-hard. Modified EDF for preemptive scheduling, arbitrary arrival times - 10-5

EDF with precedence constraints 1. Modify arrival times For any initial node J i of the precedence graph, set a i * := a i. For any task J i such that all predecessors have been processed, set a i * := max {a i, a h *+C h J h J i } 2. Modify deadlines For any terminal node J i of the precedence graph, set d i * := d i. For any task Ji such that all successors have been processed, set d i * := min {d i, d h *-C h J i J h } (J h J i : J h is a direct predecessor of J i ) - 11 - Example J 1 J 2 J 3 J 4 J 5 J 6 A i 1 0 3 1 1 1 C i 1 1 1 1 1 1 J 1 J 2 J 3 d i 5 5 6 7 4 6 J 4 J 5 J 6 J 1 J 2 J 3 J 4 J 5 J 6 0 1 2 3 4 5 6 7 8 9 10-12 - 6

EDF with precedence constraints Theorem: The given task set is schedulable such that the precedence constraints are met if and only if the modified task set is schedulable under EDF. - 13 - - 14-7

Optimal scheduling algorithms for periodic tasks - 15 - Periodic scheduling Instance i, 1 D i Instance i, j C i i 0 i T i Given: i +(j-1)t i A set of periodic tasks = { 1,, n } with phases i (arrival times of first instances of tasks), periods T i (time difference between two consecutive activations) relative deadlines D i (deadline relative to arrival times of instances) computation times C i j th instance i, j of task i with arrival time a i, j = i + (j-1) T i, deadline d i, j = i + (j-1) T i + D i, Find a feasible schedule start time s i, j and finishing time f i, j - 16-8

Assumptions A.1. Instances of periodic task i are regularly activated with constant period T i. A.2. All instances have same worst case execution time C i. A.3. All instances have same relative deadline D i, here in most cases equal to T i (i.e., d i, j = i + j T i ) A.4. All tasks in are independent. A.5. Overhead for context switches is neglected, i.e. assumed to be 0 in the theory. Basic results based on these assumptions form the core of scheduling theory. For practical applications, assumptions A.3. and A.4. can be relaxed, but results have to be extended. - 17 - Examples for periodic scheduling (1) 1 2 i 0 0 T i 2 4 C i 1 2 D i 1 4 1 2 0 1 2 3 4 5 6 7 8 9 10 11 12 Schedulable, but only preemptive schedule possible. - 18-9

Examples for periodic scheduling (2) 1 2 i 0 0 T i 2 4 C i 1 2 D i 2 4 1 2 0 1 2 3 4 5 6 7 8 9 10 11 12 Schedulable with non-preemptive schedule. - 19 - Examples for periodic scheduling (3) 1 2 i 0 0 T i 3 4 C i 2 2 D i 3 4 No feasible schedule for single processor. - 20-10

Processor utilization Definition: Given a set of n periodic tasks, the processor utilization U is given by - 21 - Processor utilization as a schedulability criterion Given: a scheduling algorithm A Define U bnd (A) = inf {U( ) is not schedulable by algorithm A}. If U bnd (A) > 0 then a simple, sufficient criterion for schedulability by A can be based on processor utilization: If U( ) < U bnd (A) then is schedulable by A. However, if U bnd (A) < U( ) 1, then may or may not be schedulable by A. Question: Does a scheduling algorithm A exist with U bnd (A) = 1? - 22-11

Processor utilization Question: Does a scheduling algorithm A exist with U bnd (A) = 1? Answer: No, if D i < T i allowed. Example: 1 2 i 0 0 T i 2 2 C i 1 1 D i 1 1 Yes, if D i = T i (or D i T i ) ) Earliest Deadline First (EDF) In the following: assume D i = T i - 23 - Earliest Deadline First (EDF) EDF is applicable to both periodic and aperiodic tasks. If there are only periodic tasks, priority-based schemes like rate monotonic scheduling (RM) (see later) are often preferred, since They are simpler due to fixed priorities use in standard OS possible sorting wrt. to deadlines at run time is not needed - 24-12

EDF and processor utilization factor Theorem: A set of periodic tasks 1,..., n with D i = T i is schedulable with EDF iff U 1. - 25 - - 26-13

- 27 - - 28-14

Rate monotonic scheduling (RM) Rate monotonic scheduling (RM) (Liu, Layland 73): Assign fixed priorities to tasks i : priority( i ) = 1/T i I.e., priority reflects release rate Always execute ready task with highest priority Preemptive: currently executing task is preempted by newly arrived task with shorter period. - 29 - Example for RM (1) 1 2 3 i 0 0 0 T i 4 6 12 C i 2 1 4 D i 4 6 12 1 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12-30 - 15

Example for RM (2) 1 2 3 i 0 0 0 T i 4 5 10 C i 2 2 1 D i 4 5 10 1 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12-31 - Optimality of Rate Monotonic Scheduling Theorem (Liu, Layland, 1973): RM is optimal among all fixed-priority scheduling algorithms. Def.: The response time R i, j of an instance j of task i is the time (measured from the arrival time) at which the instance is finished: R i, j = f i, j a i, j. The critical instant of a task is the time at which the arrival of the task will produce the largest response time. - 32-16

Response times and critical instants Observation: For RM, the critical instant t of a task i is given by the time when i, j arrives together with all tasks 1,..., i-1 with higher priority. - 33-17