17.0 RT Scheduling Priority-Driven

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Priority-Driven RT Scheduling

Embedded Real Time Systems


Prof. Davide Brugali
Università degli Studi di Bergamo
Real Time Scheduling algorithms
Earliest Due Date (static)
Earliest Deadline First (Dynamic)
Earliest Deadline First (EDF) - Dynamic
EDF example
EDF Limitations
EDF under non preemptive scheduling
Complexity
Periodic Tasks
Periodic Task model

 Task T1 = {i, pi, ei, Di}


 Task T1 = {pi, ei, Di} i = 0
 Task T1 = {pi, ei} i = 0, Di = pi

 Hyperperiod H (the least common multiple of pi)


 Task utilization : ui = ei / pi
 Total utilization U =  ui
Algoritmo Rate Monotonic (RM) - Static
Rate Monotonic (RM): Priority Assignment

 Each process is assigned a (unique) priority based on its period; the shorter
the period (the higher the frequency), the higher the priority
 These priorities do not change;
 The tasks are scheduled according to their priorities, i.e. a ready task with
highest priority is executed until a higher priority task becomes ready. Such
higher priority task then pre-empts the lower priority task.
 This assignment is optimal in the sense that if any process set can be
scheduled (using pre-emptive priority-based scheduling) with a fixed-
priority assignment scheme, then the given process set can also be scheduled
with a rate monotonic assignment scheme
Rate Monotonic: schedulability test
Theorem:
A set of independent periodic tasks scheduled by the rate monotonic algorithm will always
meet its deadlines , for all task, if
m
where  ci * f i  m(21/ m − 1)
i=1
ci = worst-case task execution time of task i
fi = frequency of task i
m= number of tasks

 For D=T task sets only


 A simple sufficient but not necessary schedulability test exists
RM: Value of the threshold factor

1/m
m m*(2 -1)
1 1 1.5

m*(2**(1/m)-1)
2 0.828427125
3 0.77976315 1
4 0.75682846 Reeks1
0.5
5 0.743491775
6 0.73477229 0
12 0.713557132
1
3
5
12
48
0
24 0.703253679

20
48 0.698176077 m
96 0.695655573
200 0.694349702
RM: Example
name execution time period Deadline
[msec] [msec] [msec]
tsk 1 20 100 100
tsk 2 40 150 150
tsk 3 100 350 350
3 20 40 100
 ci * f i = + + = 0753  3(21/3 −1) = 0.779
i=1 100 150 350
name priorities
tsk 1 high
tsk 2 middel
tsk 3 low

T1

T2 100 200

150
T3
350
EDF for Periodic tasks
RM Example
EDF Example
EDF: Domino effect
FP (fixed priority): Domino effect
EDF optimality when deadlines not = period

You might also like