RTES Lecture05
RTES Lecture05
RTES Lecture05
• Assumptions
• Fixed-priority algorithms
– Rate monotonic
– Deadline monotonic
• Dynamic-priority algorithms
– Earliest deadline first
– Least slack time
• Relative merits of fixed- and dynamic-priority scheduling
• Schedulable utilization and proof of schedulability
Copyright © 2006 University of Glasgow
• Jobs in a task may be assigned the same priority (task level fixed-
priority) or different priorities (task level dynamic-priority)
• The priority of each job is usually fixed (job level fixed-priority);
but some systems can vary the priority of a job after it has started
Copyright © 2006 University of Glasgow
T1 = (4, 1)
J2,1 J2,2 J2,3 J2,4
T2 = (5, 2)
Copyright © 2006 University of Glasgow
J3,1
T3 = (20, 5)
All rights reserved.
0 4 8 12 16 20
Deadline Monotonic Scheduling
– If deadline ≠ period
All rights reserved.
Dynamic-Priority Algorithms
T1 = (2, 1)
J2,1 J2,2 J2,3
T2 = (5, 2.5)
Copyright © 2006 University of Glasgow
All rights reserved.
0 1 2 3 4 5 6 7 8 9 10
Relative Merits
LST J1,1 J2,1 J1,2 J2,1 J1,3 J2,2 J1,4 J2,2 J1,5 J2,2
EDF J1,1 J2,1 J1,2 J2,1 J1,3 J2,2 J1,4 J2,2 J1,5 J2,2
RM J1,1 J2,1 J1,2 J2,1 J1,3 J2,1 J2,2 J1,4 J2,2 J1,5 J2,2
0 2 4 6 8 10
Copyright © 2006 University of Glasgow
• Recall: a periodic task Ti is defined by the 4-tuple (φi, pi, ei, Di)
with utilization ui = ei / pi
n
• Total utilization of the system U = " ui where 0 ≤ U ≤ 1
i=1
• Notes:
Copyright © 2006 University of Glasgow
– Result is independent of φi
– Result can also be shown to apply to strict LST
All rights reserved.
Schedulable Utilization: EDF
0 1 2 3 4 5 6 7
0.6 n
2 4 6 8 10 12 14 16 18
Copyright © 2006 University of Glasgow
• What happens if the relative deadlines for tasks are not equal to
their respective periods?
• Assume the deadline is some multiple υ of the period: Dk = υ⋅pk
• It can be shown that:
0
2 " 0 4 " 4 0.5
2
22
1
U RM (n," ) = 1 n((2" ) n #1) + 1# " for 0.5 4 " 4 1
2
2 *$ " + 1' 1 n#1 -
2" (n #1),& ) #1/ " = 2,3,...
Copyright © 2006 University of Glasgow
23 ,+% " ( /.
All rights reserved.
!
Schedulable Utilization of RM
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
Di = pi
All rights reserved.
Summary
Key points:
• Different priority scheduling algorithms
– Earliest deadline first, least slack time, rate monotonic, deadline monotonic
– Each has different properties, suited for different scenarios
• Scheduling tests, concept of maximum schedulable utilization
– Examples for different algorithms