Real-time Systems Lab, Computer Science and Engineering, ASU
Scheduling Algorithm and Analysis Interrupts and non-RM Tasks - - PowerPoint PPT Presentation
Scheduling Algorithm and Analysis Interrupts and non-RM Tasks - - PowerPoint PPT Presentation
Scheduling Algorithm and Analysis Interrupts and non-RM Tasks (Module 31) Yann-Hang Lee Arizona State University yhlee@asu.edu (480) 727-7507 Summer 2014 Real-time Systems Lab, Computer Science and Engineering, ASU Schedulability with
Real-time Systems Lab, Computer Science and Engineering, ASU
Schedulability with Interrupts
Interrupt processing can be inconsistent with rate
monotonic priority assignment.
interrupt handler executes with high priority despite its period interrupt processing may delay execution of tasks with shorter
periods
Effects of interrupt processing must be taken into
account in schedulability model.
Question is: how to do that?
1
Real-time Systems Lab, Computer Science and Engineering, ASU
Determining Schedulability with Interrupts
Task(i) Period(T) Execution Time(C) Priority(P) Deadline (D)
τ3
200 60 HW 200
τ1
100 20 High 100
τ2
150 40 Medium 150
τ4
350 40 Low 350
τ3 is an interrupt handler
2
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Any Fixed Priority
Test is applied to each task. Determine effective utilization (fi) of each task i using
when di=pi fi =
Compare effective utilization against bound, U(n).
n = num(Hn) + 1 num(Hn) = the number of tasks in the set Hn
∑ ∑
∈ ∈
+ +
1 n
H k k i i i H j j j
e p 1 p e p e
Preemption form the tasks that can hit more than once (with period less that pi) Execution of a task under test Preemption from tasks That can hit only once (with period greater than pi )
3
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Any Fixed Priority
Test is applied to each task. Determine effective utilization (fi) of each task i using
when di<pi (ei must be done within di, not pi) fi =
Compare effective utilization against bound, U(n).
n = num(Hn) + 1 num(Hn) = the number of tasks in the set Hn
∑ ∑
∈ ∈
+ +
1
1
H k k i i i H j j j
e d d e p e
n
Preemption form the tasks that can hit more than once (with period less that di) Execution of a task under test Preemption from tasks That can hit only once (with period greater than di )
4
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority: τ3
For τ3, no tasks have a higher priority:
H = Hn =H1 = { }. f3 =
Note that utilization bound is U(1): num(Hn) = 0.
Plugging in numbers:
) 1 (
3 3
U T C ≤ + +
f3 =
. 1 3 . 200 60
3 3
< = = T C
5
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority: τ1
For τ1, τ3 has a higher priority: H = {τ3}; Hn = {};
H1 = {τ3}. f1 =
) 1 ( 1
3 1 1 1
U C T T C
k k ≤
+ +
∑
=
Note that utilization bound is U(1): num(Hn) = 0.
Plugging in the numbers: f1 =
. 1 800 . 100 60 100 20
1 3 1 1
< = + = + T C T C
6
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority: τ2
For τ2 : H={τ1, τ3}; Hn={τ1 }; H1={τ3 }; Note that utilization bound is U(2): num(Hn) = 1.
Plugging in the numbers:
) 2 ( 1 f
3 2 2 2 1 2
U C T T C T C
k k j j j
≤ + + =
∑ ∑
= =
828 . 867 . 150 60 150 40 100 20 f
3 3 2 2 1 1 2
> = + + = + + = T C T C T C
7
Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority:
For τ4 : H={τ1, τ2, τ3}; Hn={τ1 , τ2, τ3 }; H1={}; Note that utilization bound is U(4): num(Hn) = 3.
Plugging in the numbers:
) 4 ( f
4 4 3 , 2 , 1 4
U T C T C
j j j
≤ + + = ∑
=
756 . 882 . 350 60 200 60 150 40 100 20 f
4 4 3 3 2 2 1 1 4
> = + + + = + + + = T C T C T C T C
8
Real-time Systems Lab, Computer Science and Engineering, ASU