Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

Similar documents
There are three priority driven approaches that we will look at

Real-Time and Embedded Systems (M) Lecture 5

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

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

EDF Feasibility and Hardware Accelerators

Aperiodic Task Scheduling

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

Real-Time Systems. Event-Driven Scheduling

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

Real-Time Systems. Event-Driven Scheduling

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

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

Embedded Systems Development

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

Andrew Morton University of Waterloo Canada

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

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

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

CPU SCHEDULING RONG ZHENG

Networked Embedded Systems WS 2016/17

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

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

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

Static priority scheduling

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

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

Clock-driven scheduling

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

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

Deadline-driven scheduling

Embedded Systems 14. Overview of embedded systems design

Real-time Systems: Scheduling Periodic Tasks

Real-Time Scheduling and Resource Management

Task Models and Scheduling

CIS 4930/6930: Principles of Cyber-Physical Systems

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

CPU scheduling. CPU Scheduling

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

Real-Time Scheduling

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

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

Schedulability analysis of global Deadline-Monotonic scheduling

CSE 380 Computer Operating Systems

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

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

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

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

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

Exam Spring Embedded Systems. Prof. L. Thiele

On-line scheduling of periodic tasks in RT OS

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

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

Online Scheduling Switch for Maintaining Data Freshness in Flexible Real-Time Systems

CHAPTER 5 - PROCESS SCHEDULING

Module 5: CPU Scheduling

Chapter 6: CPU Scheduling

Cyclic Schedules: General Structure. Frame Size Constraints

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

Multiprocessor Real-Time Scheduling Considering Concurrency and Urgency

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

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

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

CEC 450 Real-Time Systems

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

CPU Scheduling Exercises

CEC 450 Real-Time Systems

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

An Improved Schedulability Test for Uniprocessor. Periodic Task Systems

Comp 204: Computer Systems and Their Implementation. Lecture 11: Scheduling cont d

Tardiness Bounds under Global EDF Scheduling on a Multiprocessor

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

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

CycleTandem: Energy-Saving Scheduling for Real-Time Systems with Hardware Accelerators

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

Contention-Free Executions for Real-Time Multiprocessor Scheduling

Controlling Preemption for Better Schedulability in Multi-Core Systems

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

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

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

Multiprocessor Scheduling of Age Constraint Processes

Laxity dynamics and LLF schedulability analysis on multiprocessor platforms

Task Reweighting under Global Scheduling on Multiprocessors

Scheduling Lecture 1: Scheduling on One Machine

Scheduling Lecture 1: Scheduling on One Machine

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

Simulation of Process Scheduling Algorithms

Embedded Systems - FS 2018

Improved Schedulability Analysis of EDF Scheduling on Reconfigurable Hardware Devices

A Response-Time Analysis for Non-preemptive Job Sets under Global Scheduling

FPCL and FPZL Schedulability Analysis

Uniprocessor real-time scheduling

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

EDF and RM Multiprocessor Scheduling Algorithms: Survey and Performance Evaluation

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

Multiprocessor EDF and Deadline Monotonic Schedulability Analysis

CPU Scheduling. CPU Scheduler

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

Real-Time Calculus. LS 12, TU Dortmund

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

Transcription:

Real-Time Systems Lecture 6 Dynamic Priority Scheduling Online scheduling with dynamic priorities: Earliest Deadline First scheduling CPU utilization bound Optimality and comparison with RM: Schedulability level, number of preemptions, jitter and response time Other dynamic priority criteria Least Slack First, First Come First Served DETI * STR 2015/2016 1

Last lecture (5) On-line scheduling with fixed-priorities The Rate Monotonic scheduling policy schedulability analysis based on utilization The Deadline Monotonic and arbitrary deadlines scheduling policies Response-time analysis DETI * STR 2015/2016 2

On-line scheduling with dynamic priorities Scheduling is based on dynamic criteria, i.e. one that is known only at run-time The dynamic parameter used to sort the ready tasks can be understood as a dynamic priority The ready queue is sorted according with decreasing priorities whenever there is a priority change. Executes first the task that has the greater instantaneous priority Complexity O(n.log(n)) Queue with ready tasks... J 3 i J 2 k J 1 n Ready Queue Head Scheduler Queue sorted by instantaneous priorities (dynamically re-sorted) DETI * STR 2015/2016 3

On-line scheduling with dynamic priorities Pros Scales well Changes made to the task set are immediately seen by the scheduler Accommodates easily sporadic tasks Cons Complex implementation Requires a kernel supporting dynamic priorities Higher overhead Re-sorting of ready queue; depends on the algorithm Unpredictability on overloads It is not possible to know a priory which tasks will fail deadlines DETI * STR 2015/2016 4

On-line scheduling with dynamic priorities Priority allocation Inversely proportional to the time to the deadline EDF Earliest Deadline First Optimal among all dynamic priority criteria Inversely proportional to the laxity or slack LSF (LST or LLF) Least Slack First Optimal among all dynamic priority criteria Inversely proportional to the service waiting time FCFS First Come First Served etc. Not optimal with respect to meet deadlines; extremely poor real-time performance DETI * STR 2015/2016 5

On-line scheduling with dynamic priorities Schedulability tests Since the schedule is built online it is important to determine a priori if a given task set meets or not its temporal requirements There are three types of schedulability tests: Based on the CPU utilization Based on the CPU load (processor demand) Based on the response time DETI * STR 2015/2016 6

EDF Scheduling EDF tests based on CPU utilization (n independent tasks, with preemption) D=T n U (n)= i=1 C i T i 1 Task set is schedulable Allows using 100% of CPU with timeliness guarantees D<T n i=1 C i D i 1 Task set is schedulable Pessimistic test D T n i=1 C i 1 Task set is schedulable min(d i,t i ) DETI * STR 2015/2016 7

RM Scheduling - example Task set τ i T i C i 1 3 1 2 4 1 3 6 2.1 Synchronous release τ 3 t=6 Deadline miss U = 1/3 + 1/4 + 2.1/6 = 0.93 > 0.78 1 activation per period NOT guaranteed. τ 3 fails a deadline! DETI * STR 2015/2016 8

EDF Scheduling same example Task set τ i T i C i 1 3 1 2 4 1 Synchronous release (irrelevant in EDF if D=T) τ 3 3 6 2.1 t=6 U = 1/3 + 1/4 + 2.1/6 = 0.93 1 1 activation per period guaranteed DETI * STR 2015/2016 9

EDF Scheduling same example Task set τ i T i C i 1 3 1 2 4 1 Synchronous release (irrelevant in EDF if D=T) τ 3 3 6 2.1 t=6 Note: No deadline misses Less preemptions Higher jitter on quicker tasks The worst-case response time does not coincide necessarily with the synchronous release DETI * STR 2015/2016 10

RM vs EDF scheduling initial phases Initial phase O 3 RM scheduling became feasible! Task set τ i T i C i O i 1 3 1 0 2 4 1 0 3 6 2.1 2.5 τ 3 t=6 With EDF the initial phase is irrelevant (if D=T) τ 3 DETI * STR 2015/2016 11 t=6

RM vs EDF scheduling particular cases RM U = 1/2 + 2/4 = 1 t=4 EDF t=4 The actual resulting schedule depends on the criteria to break ties. Independently of the criteria, deadlines are met. DETI * STR 2015/2016 12

RM vs EDF scheduling particular cases RM U = 1/2 + 2/5 = 0.9 C 1 or C 2 cannot increase, otherwise deadlines will be missed! t=5 EDF C 1 or C 2 may increase without causing deadlines misses, until U=1 t=5 C 2 = 2.5 U=1 DETI * STR 2015/2016 13 t=5

Notion of fairness Be fair on the attribution of resources (e.g. CPU) EDF Scheduling EDF is intrinsically fairer than RM, in the sense that tasks see its relative deadline increased as the absolute deadline approaches, independently of its period or any other static parameter. Consequences: Deadlines are easier to met As the deadlines approach preemptions are reduced The slack of tasks that are quick but have large deadlines can be used by other task (higher jitter on tasks with shorter periods) DETI * STR 2015/2016 14

CPU Load Analysis For D T, the bigger period during which the CPU is permanently used (i.e. without interruption, idle time) corresponds to the scenario in which all tasks are activated synchronously. This period is called synchronous busy period and has duration L L can be computed by the following iterative method, which returns the first instant since the synchronous activation in which the CPU completes all the submitted jobs L(0)= C i i L(m+ 1)= ( L(m) C i T i ) i DETI * STR 2015/2016 15

CPU Load Analysis Knowing L, we have to guarantee the load condition, i.e. h(t) t, t [0, L] Task ser is schedulable (synchronous activations) In which h(t) is the load function h(t )= max (0,1+ (t D i) ) C i=1.. n T i i The computation of h(t) for t [0,L) is unfeasible. However it is enough computing the load condition for the instants in which the load function varies, i.e. S=U i S i,s i ={m T i D i : m=0,1,...} Note: there are other, possibly shorter, values for L L= i=1.. n (T i D i ) U i, if D 1 U i T i, i I. Ripoll, A. Crespo, and A.K. Mok. Improvement in Feasibility Testing for Real-TimeTasks. Journal of Real-Time Systems, 11 (1):19-39, 1996. DETI * STR 2015/2016 16

CPU Load Analysis Illustration of h(t) Task with T=D=4; C=1 Floor function http://upload.wikimedia.org/wikipedia/commons/thumb/e/e1/flo or_function.svg/500px-floor_function.svg.png t t-d floor((t-d)/t) h(t) 0-4 -1 0 1-3 -1 0 2-2 -1 0 3-1 -1 0 Load 4 0 0 1 5 1 0 1 6 2 0 1 1.2 1 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 DETI * STR 2015/2016 17 h(t) t

EDF Scheduling L=16 Task set τ 3 τ i C i D i T i 1 1 3 10 2 2 18 20 t=10 t=20 3 3 4 4 n i=1 C i min(d i,t i ) = 1 3 + 2 18 + 3 =1.194>1 Schedulability not guaranteed 4 The CPU load analysis indicates that the task set is schedulable! DETI * STR 2015/2016 18

Response-time analysis With EDF, the response time analysis is more complex than with fixed priorities because we don't know a priori which instance suffers the maximum interference However, it is possible computing the worst-case response time using the notion of busy period relative to the deadline An upper bound to the response time can be easily obtained with the following expression, valid id U 1 i, Rwc i T i U Note that thus upper bound is very pessimistic! DETI * STR 2015/2016 19

LSF Scheduling LSF vs EDF short comparison LS is optimal (as EDF) As slack Priority Priority of ready tasks increases as time goes by Priority of the task in the running state does not change On EDF the priorities of all tasks (ready and executing) increase equally as time goes by Rescheduling on instants where there are activations or terminations Causes an higher number of preemptions than EDF (and thus higher overhead) No significant advantages with respect to EDF! DETI * STR 2015/2016 20

LSF scheduling same example EDF τ 3 Task set τ i T i C i 1 3 1 2 4 1 3 6 2.1 t=6 LSF τ 3 DETI * STR 2015/2016 21 t=6

FCFS Scheduling A brief comparison between FCFS and EDF/LLF Non optimal May lead to deadline misses even with very low CPU utilization rates Job age Priority Priority of the ready and running tasks increases as time goes by (an in EDF) New jobs always get the lower priority There are no preeemptions (smaller overhead and facilitates the implementation) Very poor temporal behavior! DETI * STR 2015/2016 22

FCFS same example EDF τ 3 Task set τ i T i C i 1 3 1 2 4 1 3 6 2.1 t=6 FCFS τ 3 When the age is the same the tie break criteria is decisive! DETI * STR 2015/2016 23 t=6

Summary of lecture 6 On-line scheduling with dynamic priorities The EDF - Earliest Deadline First criteria: CPU utilization bound Optimality of EDF and comparison with RM: Schedulability level, number of preemptions, jitter and response time Other dynamic priority criteria: LLF (LST) - Least Laxity (Slack) First FCFS - First Come First Served DETI * STR 2015/2016 24