kukum real time system 1/21 module 2 real time system scheduling lecture 05

21
Real Time System 1/21 KUKUM Module 2 Real Time System Scheduling Lecture 05

Upload: chad-chambers

Post on 17-Jan-2016

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 1/21

KUKUM

Module 2Real Time System

Scheduling

Lecture 05

Page 2: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 2/21

KUKUM

Lecture Outline

• Fixed-priority scheduling– Optimality of RM and DM– General schedulability tests and time demand

analysis

• Practical factors– Non-preemptable regions– Self-suspension– Context switches– Limited priority levels

Page 3: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 3/21

KUKUM

Optimality of RM and DM Algorithms

• In the general case RM and DM algorithms are not optimal– Some systems cannot be scheduled (URM < 1)– Complex expressions for maximum schedulable utilization

discussed in last lecture

• However, RM and DM are optimal in simply periodic systems– A system of periodic tasks is simply periodic if the period of each

task is an integer multiple of the period of the other tasks:pk = n⋅pi

– where pi < pk and n is a positive integer; for all Ti and Tk– This is true for many real-world systems

Page 4: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 4/21

KUKUM

Optimality of RM and DM Algorithms

• Theorem: A system of simply periodic, independent, preemptable tasks with Di≥pi is schedulable on one processor using the RM algorithm if and only if U ≤ 1– Corollary: The same is true for the DM

algorithm

Page 5: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 5/21

KUKUM

Schedulability of Fixed-Priority Tasks

• We have identified several simple schedulability tests for fixed priority scheduling:– A system of n independent preemptable periodic tasks with Di = pi can

be feasibly scheduled on one processor using RM if and only if U ≤ n (21/n – 1)⋅

– A system of simply periodic independent preemptable tasks with Di ≥ pi is schedulable on one processor using the RM algorithm if and only if U ≤ 1

– [similar results for DM]

• But: there are algorithms and regions of operation where we don’t have a schedulability test and must resort to exhaustive simulation– Is there a more general schedulability test? Yes, but not as simple as

those we’ve seen so far…

Page 6: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 6/21

KUKUM

Schedulability Test for Fixed-Priority Tasks

• Fixed priority algorithms are predictable and do not suffer from scheduling anomalies– The worst case execution time of the system occurs with the

worst case execution time of the jobs– Unlike dynamic priority algorithms, which can exhibit anomalous

behaviour

• Use this as the basis for a general schedulability test:1. Find the critical instant when the system is most loaded, and

has its worst response time2. Use time demand analysis to determine if the system is

schedulable at that instant3. Prove that, if a fixed-priority system is schedulable at the critical

instant, it is always schedulable

Page 7: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 7/21

KUKUM

1. Finding the Critical Instant

Page 8: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 8/21

KUKUM

Finding the Critical Instant

Page 9: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 9/21

KUKUM

Page 10: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 10/21

KUKUM

Using the Critical Instant

• Having determined the critical instants, show that for each job Ji,c released at a critical instant, that job and all higher priority tasks complete executing before their relative deadlines

• If so, the entire system be schedulable…

• That is: don’t simulate the entire system, simply show that it has correct characteristics following a critical instant– This process is called time demand analysis

Page 11: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 11/21

KUKUM

2. Time-Demand Analysis

Page 12: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 12/21

KUKUM

Time Demand Analysis

Page 13: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 13/21

KUKUM

Time Demand Analysis

Page 14: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 14/21

KUKUM

Time Demand Analysis

Page 15: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 15/21

KUKUM

Time Demand Analysis

Page 16: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 16/21

KUKUM

Time demand Analysis: Summary

Page 17: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 17/21

KUKUM

Practical Factors

Page 18: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 18/21

KUKUM

Blocking and Priority Inversion

Page 19: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 19/21

KUKUM

Self-Suspension and Context Switches

Page 20: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 20/21

KUKUM

Tick Scheduling

Page 21: KUKUM Real Time System 1/21 Module 2 Real Time System Scheduling Lecture 05

Real Time System 21/21

KUKUM