Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

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

Embedded Systems Development

Andrew Morton University of Waterloo Canada

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

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

Real-Time Systems. Event-Driven Scheduling

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

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

Static priority scheduling

EDF Feasibility and Hardware Accelerators

Schedulability analysis of global Deadline-Monotonic scheduling

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

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

Real-Time Systems. Event-Driven Scheduling

On-line scheduling of periodic tasks in RT OS

CPU SCHEDULING RONG ZHENG

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

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

Lec. 7: Real-Time Scheduling

CEC 450 Real-Time Systems

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

Real-Time and Embedded Systems (M) Lecture 5

Rate-monotonic scheduling on uniform multiprocessors

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

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

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

Real-Time Scheduling and Resource Management

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

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

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

A Note on Modeling Self-Suspending Time as Blocking Time in Real-Time Systems

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

Networked Embedded Systems WS 2016/17

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

Task Models and Scheduling

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

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

CIS 4930/6930: Principles of Cyber-Physical Systems

Rate Monotonic Analysis (RMA)

There are three priority driven approaches that we will look at

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

On Non-Preemptive Scheduling of Periodic and Sporadic Tasks

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

Real-time Systems: Scheduling Periodic Tasks

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

An Improved Schedulability Test for Uniprocessor. Periodic Task Systems

The Feasibility Analysis of Multiprocessor Real-Time Systems

Mitra Nasri* Morteza Mohaqeqi Gerhard Fohler

Aperiodic Task Scheduling

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

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

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

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

Process Scheduling. Process Scheduling. CPU and I/O Bursts. CPU - I/O Burst Cycle. Variations in Bursts. Histogram of CPU Burst Times

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

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

EDF and RM Multiprocessor Scheduling Algorithms: Survey and Performance Evaluation

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

CEC 450 Real-Time Systems

Deadline-driven scheduling

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

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

A PTAS for Static Priority Real-Time Scheduling with Resource Augmentation

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

Exam Spring Embedded Systems. Prof. L. Thiele

TEMPORAL WORKLOAD ANALYSIS AND ITS APPLICATION TO POWER-AWARE SCHEDULING

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

arxiv: v1 [cs.os] 25 May 2011

Multiprocessor EDF and Deadline Monotonic Schedulability Analysis

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

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

Necessary and Sufficient Conditions for Non-Preemptive Robustness

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

Module 5: CPU Scheduling

arxiv: v1 [cs.os] 21 May 2008

Clock-driven scheduling

Chapter 6: CPU Scheduling

AS computer hardware technology advances, both

Task assignment in heterogeneous multiprocessor platforms

A New Task Model and Utilization Bound for Uniform Multiprocessors

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

The Partitioned Dynamic-priority Scheduling of Sporadic Task Systems

Embedded Systems 14. Overview of embedded systems design

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

CPU scheduling. CPU Scheduling

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

Partitioned scheduling of sporadic task systems: an ILP-based approach

Time and Schedulability Analysis of Stateflow Models

Schedulability Analysis for the Abort-and-Restart (AR) Model

Multiprocessor Real-Time Scheduling Considering Concurrency and Urgency

the currently active 1 job whose deadline parameter is the smallest, is an optimal scheduling algorithm in the sense that if a system can be scheduled

Fixed Priority Scheduling

Improved Deadline Monotonic Scheduling With Dynamic and Intelligent Time Slice for Real-time Systems

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

Controlling Preemption for Better Schedulability in Multi-Core Systems

2/5/07 CSE 30341: Operating Systems Principles

Design of Real-Time Software

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

CSE 380 Computer Operating Systems

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

Transcription:

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment C. Liu and J. Layland Journal of the ACM, 20(1):46--61, January 1973.

2 Contents 1. Introduction and Background 2. The Environment 3. A Fixed Priority Scheduling Algorithm 4. Achievable Processor Utilization 5. The Deadline Driven Scheduling Algorithm 2

3 Introduction and Background The use of computers for Time-critical control and monitoring of industrial processes Two scheduling algorithms are studied Both are priority driven and preemptive The processing of any task is interrupted by a request for any higher priority task The first one Fixed priority assignment algorithm The second one Dynamic priority assignment 3

4 The Environment Five assumptions (A1) The request for all tasks for which hard deadlines exist are periodic (A2) Deadlines consist of run-ability constraints only Each task must be completed before the next request for it occurs (A3) 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 (A4) 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 (A5) Any nonperiodic tasks in the system are special; they are initialization or fault-recovery routines; they displace periodic tasks while themselves are being run, and do not themselves have hard, critical deadlines 4

5 A Fixed Priority Scheduling Algorithm (1) Task and scheduling model Deadline of a request The time of the next request for the same task Overflow of a request Unfulfilled request by its deadline Feasible algorithm If tasks are scheduled so that no overflow ever occurs Response time of a request The time span between the request and the end of the response to that request Critical instant of a task An instant at which a request for that task will have the largest response time Critical time zone for a task The time interval between a critical instant and the deadline of the corresponding request of the task 5

6 A Fixed Priority Scheduling Algorithm (2) Theorem 1. A critical instant for any task occurs whenever the task is requested simultaneously with requests for all higher priority tasks Proof. Advancing the request time will not speed up the completion of m t 2 6

7 A Fixed Priority Scheduling Algorithm (3) Important value of Theorem 1 A simple direct calculation can determine whether or not a given priority assignment will yield a feasible scheduling algorithm Example: two tasks 1 and 2 T1 2, C1 1 T, C 1 2 5 2 7

8 A Fixed Priority Scheduling Algorithm (4) The following inequalities must be met for feasibility 1 If is the highest priority task (method 1) (1) 2 If is the highest priority task (method 2) (2) It follows from (2) that Whenever T1 T 2 and 2 has the highest priority, Ineq.(2) implies Ineq.(1) Ineq.(1) is a weaker condition If a task set is schedulable by method 2, then it is also schedulable by method 1 8

9 A Fixed Priority Scheduling Algorithm (5) Reasonable rule of priority assignment Assign priorities according to request rates, independent of run-times Tasks with higher request rates will have higher priorities Rate-monotonic priority assignment Optimum in the sense that no other fixed priority assignment rule can schedule a task set which cannot be scheduled by the rate-monotonic priority assignment Theorem 2. If a feasible priority assignment exists for some task set, the rate monotonic priority assignment is feasible for that task set Proof. By an inter-change argument 9

10 Achievable Processor Utilization (1) Utilization factor The fraction of processor time spent in the execution of the task set The utilization factor is equal to one minus the fraction of idle processor time Utilization factor can be improved by Increasing run-times and decreasing periods However, utilization factor is upper bounded by the requirement of feasibility (meeting deadlines) How large the processor utilization factor can be? 10

11 Achievable Processor Utilization (2) Full utilization of processor A set of tasks is said to fully utilize the processor if the priority assignment is feasible for the set and if an increase in the run-time of any of the tasks in the set will make the priority assignment infeasible LUB (least upper bound) of utilization factor The minimum of utilization factor over all sets of tasks that fully utilize the processor For all task sets whose utilization factor is below this bound, there exists a fixed priority assignment which is feasible 11

12 Achievable Processor Utilization (3) Schedulable Utilization Bound 12

13 Achievable Processor Utilization (4) Theorem 3. For a set of two tasks with fixed priority assignment, the least upper bound to the 1/ 2 processor utilization factor is U 2(2 1) Proof. See Theorem 4 13

14 Achievable Processor Utilization (5) Theorem 4. For a set of m tasks with fixed priority order, and the restriction that the ratio between any two request periods is less than 2, the least upper bound to the processor utilization factor is 1/ m U m(2 1) Proof. (1) We first show that the LUB can be found when C1 T2 T1 Ck, Tk 1 Tk, and Cm Tm 2( C1 C2... Cm 1) 2T1 Tm (2) We then compute the LUB 14

15 Achievable Processor Utilization (6) We first show that the LUB can be found when C1 T2 T1, C T T, and C 2T T k k 1 k m 1 m Proof (1). For 0 (1) Suppose that C1 T2 T1 and the task set S fully utilize We can construct another set S such that ' ' ' C1 T2 T1, C2 C 2, and Ck Ck ' ' S fully utilize since C1 C2 C1 C2 U U / T1 / T2 0 (2) Suppose that C1 T2 T1 and the task set S fully utilize We can construct another set S such that ' ' ' C1 T2 T1, C2 C2 2, and Ck Ck S fully utilize U U / T1 2 / T2 0 Similarly, we can show that C T T k k 1 k 15

16 Achievable Processor Utilization (7) Illustration Case (1) T m Case (2) consider this interval Case for LUB 16

17 Achievable Processor Utilization (8) We next compute the LUB Using the previous results, we can write U ( T2 T1 ) / T1 ( T3 T2 ) / T2... (2T1 T m ) / T m T2 / T1 1 T3 / T2 1... 2T1 / Tm 1 T2 / T1 T3 / T2... 2T1 / Tm m Let R i Ti 1 / Ti T1 T1 Tm 1... T3T 2 Tm 1Tm 2... T3T 1 1/ Rm 1Rm 2... R T T T... T T T T... T T m m m 1 3 2 m m 1 U R1 R2... Ri... 2 /( Rm 1... R1 ) m 3 2 1 17

18 Achievable Processor Utilization (9) Given U R1 R2... Ri... 2 /( Rm 1... R1 ) m To find the minimum, we solve the following 2 U / R 1 2( R... R ) /( R... R... R ) 0 i R i m 1 1 m 1 i 1 2 /( Rm 1Rm 2... R2R1 ) This implies R1 R2... Rm 1, thus Finally it follows that U ( m 1)2 ( m 1)2 1 m 1 m m 1 m 2 /(2 ) m ( m 1)2 1 1 m m 2 m m(2 1) R i 1 m 1/ 2 m 2 /(2 1 1 m ) m 18

19 Achievable Processor Utilization (10) 1/3 For m=3, U 3(2 1) For large m, U ln 2 0.78 The restriction that the largest ratio between request period less than 2 can be removed Theorem 5. For a set of m tasks with fixed priority order, the least upper bound to processor 1/ m utilization is m(2 1) 19

20 Achievable Processor Utilization (11) Outline of proof of Theorem 5 The idea is that if a set of tasks fully utilizes the processor and for some i, i < m then we can always construct another set of tasks that will (1) fully utilize the processor, (2) and (3) the utilization of the new set is less than the original one 20

21 The Deadline Driven Scheduling Algorithm Priorities are assigned to tasks according to the deadlines of their current requests A task will be assigned the highest priority if the deadline of its current request is the nearest At any instant, the task with the highest priority and yet unfulfilled request will be executed This method of assigning priorities is a dynamic one We want to establish a necessary and sufficient condition for the feasibility of the deadline driven scheduling algorithm 21

22 The Deadline Driven Scheduling Algorithm Theorem 6. When the deadline driven scheduling algorithm is used to schedule a set of tasks on a processor, there is no processor idle time prior to an overflow Proof. Shifting a, b,.., c to t 2 leads to a contradiction 22

23 The Deadline Driven Scheduling Algorithm Theorem 7. For a given set of m tasks, the deadline driven scheduling algorithm is feasible if and only if U C T C / T... C m / T 1 Proof. 1 / 1 2 2 m (1) To show the necessity, compute the total demand of computation time between 0, T, T... T ] [ 1 2 m 23

24 The Deadline Driven Scheduling Algorithm Proof of Theorem 7. (2) To show the sufficiency, assume that the algorithm is not feasible and U C1 / T1 C2 / T2... C m / Tm 1 There will be an overflow at t T in the interval 0, T T There is no idle time in the interval [0, T] a, a, a,..., b, b, 3... Let 2 3 1 2 denote the request times immediately before T 1 b a, a, 3,... Let 2 are the request times of tasks with deadlines at T 1 a b1, b, b3,... Let 2 are the request times of tasks with deadlines beyond T [ 1 2... Tm ] 24

25 The Deadline Driven Scheduling Algorithm Proof of Theorem 7. Two cases must be considered Case 1. None of the computation times of requested at was carried out before T Case 2. Some of the computation times of requested at was carried out before T b1, b2, b3,... b1, b2, b3,... 25

26 The Deadline Driven Scheduling Algorithm Proof of Theorem 7. Case 1. The total demand of computation time in the interval [0, T] Since there is no idle period Thus This is a contradiction 26

27 The Deadline Driven Scheduling Algorithm Proof of Theorem 7. Case 2. There must exist a point T such that none of requests at b1, b2, b3,... was carried out in the interval [T, T] In other words, only those requests with deadline at or before T will be executed Note that since some of the requests at b1, b2, b3,... can be executed until T, all those requests initiated before T with deadlines at or before T have been fulfilled before T Therefore, the total demand of computation time in the interval [T, T] is less than or equal to Since an overflow occurs,, which is a contradiction 27

28 The Deadline Driven Scheduling Algorithm 28

29 The Deadline Driven Scheduling Algorithm Deadline driven scheduling algorithm is optimum If a set of tasks can be scheduled by any algorithm, it can be scheduled by the deadline driven algorithm This claim comes from Theorem 7 If a set of tasks can be scheduled by any algorithm, their CPU utilization is no greater than one Therefore, the task set can also be scheduled by the deadline driven scheduling algorithm 29

30 Quiz 1. When will a task have the largest response time under the Liu and Layland s assumptions? (10 points) 2. What does fully utilize mean? (10 points) 3. Suppose that we have a set of three tasks that follow the Liu and Layland s task model. Their attributes are given as follows. (30 points) Task A: period = 2, execution time = 1 Task B: period = 5, execution time = 1.5 Task C: period = 9, execution time = x 1) What is the execution time of Task C that makes the above task set to fully utilize the processor under the rate monotonic priority assignment? (10 points) 2) Response time of a task is defined as the time between its arrival and completion. What is the largest response time of Task C? (10 points) 3) What is the response time of Task C if we schedule the above tasks in a nonpreemptive manner yet with the rate monotonic priority assignment? Assume that the tasks are simultaneously released. (10 points) 30