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

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

Real-time Systems: Scheduling Periodic Tasks

Real-Time and Embedded Systems (M) Lecture 5

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

There are three priority driven approaches that we will look at

Real-Time Systems. Event-Driven Scheduling

Real-Time Systems. Event-Driven Scheduling

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

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

Static priority scheduling

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

Embedded Systems Development

Andrew Morton University of Waterloo Canada

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

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

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

Deadline-driven scheduling

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

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

Networked Embedded Systems WS 2016/17

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

Task Models and Scheduling

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

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

Real-Time Scheduling

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

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

Embedded Systems 14. Overview of embedded systems design

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

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

EDF Feasibility and Hardware Accelerators

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

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

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

Clock-driven scheduling

CIS 4930/6930: Principles of Cyber-Physical Systems

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

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

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

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

Aperiodic Task Scheduling

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

CPU SCHEDULING RONG ZHENG

Real-Time Scheduling and Resource Management

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

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

Multiprocessor Scheduling I: Partitioned Scheduling. LS 12, TU Dortmund

Schedulability analysis of global Deadline-Monotonic scheduling

Exam Spring Embedded Systems. Prof. L. Thiele

An Improved Schedulability Test for Uniprocessor. Periodic Task Systems

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

On the Design and Application of Thermal Isolation Servers

Rate-monotonic scheduling on uniform multiprocessors

CEC 450 Real-Time Systems

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

The FMLP + : An Asymptotically Optimal Real-Time Locking Protocol for Suspension-Aware Analysis

On-line scheduling of periodic tasks in RT OS

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

Cyclic Schedules: General Structure. Frame Size Constraints

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017

EDF and RM Multiprocessor Scheduling Algorithms: Survey and Performance Evaluation

System Model. Real-Time systems. Giuseppe Lipari. Scuola Superiore Sant Anna Pisa -Italy

Scheduling Lecture 1: Scheduling on One Machine

Rate Monotonic Analysis (RMA)

Supplement of Improvement of Real-Time Multi-Core Schedulability with Forced Non- Preemption

Scheduling Lecture 1: Scheduling on One Machine

Lightweight Real-Time Synchronization under P-EDF on Symmetric and Asymmetric Multiprocessors

AS computer hardware technology advances, both

Simple Dispatch Rules

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

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

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

Lecture: Workload Models (Advanced Topic)

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

Online Energy-Aware I/O Device Scheduling for Hard Real-Time Systems with Shared Resources

Algorithm Design and Analysis

A New Task Model and Utilization Bound for Uniform Multiprocessors

Multiprocessor EDF and Deadline Monotonic Schedulability Analysis

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

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

CEC 450 Real-Time Systems

Schedulability Analysis for the Abort-and-Restart Model

Multiprocessor Scheduling of Age Constraint Processes

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

Real-Time Systems. LS 12, TU Dortmund

CS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring / 1

Task assignment in heterogeneous multiprocessor platforms

Tardiness Bounds under Global EDF Scheduling on a. Multiprocessor

Cache-Aware Compositional Analysis of Real- Time Multicore Virtualization Platforms

2.1 Task and Scheduling Model. 2.2 Definitions and Schedulability Guarantees

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan

A 2-Approximation Algorithm for Scheduling Parallel and Time-Sensitive Applications to Maximize Total Accrued Utility Value

Worst-case response time analysis of real-time tasks under fixed-priority scheduling with deferred preemption revisited

Shedding the Shackles of Time-Division Multiplexing

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

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

The Partitioned Dynamic-priority Scheduling of Sporadic Task Systems

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

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

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

Transcription:

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

Lecture Outline The rate monotonic algorithm (cont d) Maximum utilisation test The deadline monotonic algorithm The earliest deadline first algorithm Definition Optimality Maximum utilisation test The least slack time algorithm Discussion "2

Rate Monotonic: Other Scheduling Tests Exhaustive simulation and time-demand analysis complex and error prone Simple scheduling tests derived for some cases: Simply periodic systems Maximum utilisation test "3

Simply Periodic Systems In a simply periodic system, the periods of all tasks are integer multiples of each other pk = n pi for all i, k such that pi < pk where n is a positive integer True for many real-world systems, since easy to engineer around multiples of a single run loop "4

Simply Periodic Rate Monotonic Tasks Rate monotonic optimal for simply periodic systems A set of simply periodic, independent, preemptable tasks with Di pi can be scheduled on a single processor using RM provided U 1 Proof follows from time-demand analysis: A simply periodic system, assume tasks in phase Worst case execution time occurs when tasks in phase Ti misses deadline at time t where t is an integer multiple of pi Again, worst case Di = pi Simply periodic t integer multiple of periods of all higher priority tasks ix e k t = t U i p k Total time required to complete jobs with deadline t is Only fails when Ui > 1 k=1 "5

Maximum Utilisation Tests Simply periodic systems have a simple maximum utilisation test Possible to generalise the result to general rate monotonic systems Derive a maximum utilisation, such that it is guaranteed a feasible schedule exists provided the maximum is not exceeded "6

RM Maximum Utilisation Test: Di = pi A system of n independent preemptable periodic tasks with Di = pi can be feasibly scheduled on one processor using rate monotonic if U n (2 1/n 1) U RM (n) URM(n) = n (2 1/n 1) For large n ln 2 (i.e., n 0.69314718056 ) 0.9 0.8 See Jane W. S. Liu, Real-time systems, Section 6.7 for proof U URM(n) is a sufficient, but not necessary, condition i.e., a feasible rate monotonic schedule is guaranteed to exist if U URM(n), but might still be possible if U > URM(n) 0.7 0.6 2 4 6 8 10 12 14 16 18 n "7

RM Maximum Utilisation Test: Di = υ pi Maximum utilisation varies if relative deadline and period differ For n tasks, where the relative deadline D k = υ pk it can be shown that: U RM (n, v) = 8 < : v for 0 apple v apple 0.5 n((2v) 1 n 1) + 1 v for 0.5 apple v apple 1 v(n 1)[( v+1 v ) 1 n 1 1] for v =2, 3,... (you are not expected to remember this formula but should understand how the utilisation changes in general terms) "8

RM Maximum Utilisation Test: Di = υ pi n υ = 4.0 υ = 3.0 υ = 2.0 υ = 1.0 υ = 0.9 υ = 0.8 υ = 0.7 υ = 0.6 υ = 0.5 2 0.944 0.928 0.898 0.828 0.783 0.729 0.666 0.590 0.500 3 0.926 0.906 0.868 0.779 0.749 0.708 0.656 0.588 0.500 4 0.917 0.894 0.853 0.756 0.733 0.698 0.651 0.586 0.500 5 0.912 0.888 0.844 0.743 0.723 0.692 0.648 0.585 0.500 6 0.909 0.884 0.838 0.734 0.717 0.688 0.646 0.585 0.500 7 0.906 0.881 0.834 0.728 0.713 0.686 0.644 0.584 0.500 8 0.905 0.878 0.831 0.724 0.709 0.684 0.643 0.584 0.500 9 0.903 0.876 0.829 0.720 0.707 0.682 0.642 0.584 0.500 0.892 0.863 0.810 0.693 0.687 0.670 0.636 0.582 0.500 D i > p i Maximum utilisation increases D i < p i Maximum utilisation decreases D i = p i "9

The Deadline Monotonic Algorithm Assign priorities to jobs in each task based on the relative deadline of that task Shorter relative deadline higher the priority If relative deadline equals period, schedule is identical to rate monotonic When the relative deadlines and periods differ: deadline monotonic can sometimes produce a feasible schedule in cases where rate monotonic cannot; rate monotonic always fails when deadline monotonic fails Hence deadline monotonic preferred if deadline period Not widely used periodic systems typically have relative deadline equal to their period "10

The Earliest Deadline First Algorithm Assign priority to jobs based on deadline: earlier deadline = higher priority Rationale: do the most urgent thing first Dynamic priority algorithm: priority of a job depends on relative deadlines of all active tasks May change over time as other jobs complete or are released May differ from other jobs in the task "11

Earliest Deadline First: Example Time Ready to run Running 0 J 2,1 J 1,1 1 J 2,1 2 J 2,1 J 1,2 3 J 2,1 Time Ready to run Running 8 J 2,2 J 1,5 9 J 2,2 10 J 2,3 J 1,6 4 J 1,3 J 2,1 4.5 J 1,3 5 J 2,2 J 1,3 5.5 J 2,2 6 J 2,2 J 1,4 7 J 2,2 Released J 1,1 J 1,2 J 1,3 J 1,4 J 1,5 J 2,1 J 2,2 J 2,3 J 1,6 T 1 = (2, 1) T 2 = (5, 2.5) J 1,1 J 2,1 J 1,2 J 2,1 J 1,3 J 2,2 J 1,4 J 2,2 J 1,5 J 2,2 0 1 2 3 4 5 6 7 8 9 10 "12

Earliest Deadline First is Optimal EDF is optimal, provided the system has a single processor, preemption is allowed, and jobs don t contend for resources That is, it will find a feasible schedule if one exists, not that it will always be able to schedule a set of tasks EDF is not optimal with multiple processors, or if preemption is not allowed "13

Earliest Deadline First is Optimal: Proof Any feasible schedule can be transformed into an EDF schedule If Ji is scheduled to run before Jk, but Ji s deadline is later than Jk s either: The release time of Jk is after the Ji completes they re already in EDF order The release time of Jk is before the end of the interval when Ji executes: J i J k r k d k d i Swap Ji and Jk (this is always possible, since Ji s deadline is later than Jk s) Move any jobs following idle periods forward into the idle period J k J k J k The result is an EDF schedule So, if EDF fails to produce a feasible schedule, no such schedule exists If a feasible schedule existed it could be transformed into an EDF schedule, contradicting the statement that EDF failed to produce a feasible schedule [proof for LST is similar] J k J i J i "14

Maximum Utilisation Test: Di pi Theorem: A system of independent preemptable periodic tasks with Di pi can be feasibly scheduled on one processor using EDF if and only if U 1 Note: result is independent of φi Proof follows from optimality of the system [Proof in the book, Section 6.3.1] "15

Maximum Utilisation Test: Di < pi Test fails if Di < pi for some i E.g. T1 = (2, 0.8), T2=(5, 2.3, 3) However, there is an alternative test: The density of the task, Ti, is δi = ei / min(di, pi) The density of the system is Δ = δ1 + δ2 + + δn Theorem: A system T of independent, preemptable periodic tasks can be feasibly scheduled on one processor using EDT if Δ 1. Note: This is a sufficient condition, but not a necessary condition i.e. a system is guaranteed to be feasible if Δ 1, but might still be feasible if Δ > 1 (would have to run the exhaustive simulation to prove) "16 J 2,1 is preempted and misses deadline J 1,1 J 2,1 J 1,2 J 2,1 J 1,3 J 2,2 J 1,4 0 1 2 3 4 5 6 7 J 2,2

The Least Slack Time Algorithm Least Slack Time first (LST) A job Ji has deadline di, execution time ei, and was released at time ri At time t < di: remaining execution time trem = ei (t ri) Assign priority based on least slack time, tslack = di t trem Two variants: Strict LST scheduling decision made whenever a queued job s slack time becomes smaller than the executing job s slack time high overhead, not used; Non-strict LST scheduling decisions made only when jobs release or complete More complex, requires knowledge of execution times and deadlines Infrequently used, since has similar behaviour to EDF, but more complex "17

Discussion EDF is optimal, and simpler to prove correct why use RM? RM more widely supported since easier to retro-fit to standard fixed priority scheduler, and support included in POSIX real-time APIs RM more predictable: worst case execution time of a task occurs with worst case execution time of the component jobs not always true for EDF, where speeding up one job can increase overall execution time (known as a scheduling anomaly ) "18

Summary The rate monotonic algorithm Simply periodic systems Maximum utilisation test The earliest deadline first algorithm Optimality Maximum utilisation tests Other algorithms Deadline monotonic Least slack time "19