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 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 Priority(P) Deadline Time(C) (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 ( f i ) of each task i using when d i =p i e e 1 ∑ ∑ + + j i e k p p p f i = ∈ ∈ j H k H j i i n 1 Preemption from tasks Preemption form the Execution of a tasks that can hit more task under test That can hit only once than once (with period (with period greater than less that p i ) p i ) Compare effective utilization against bound, U(n). n = num(H n ) + 1 num(H n ) = the number of tasks in the set H n 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 ( f i ) of each task i using when d i <p i (e i must be done within d i, not pi) e 1 ∑ e ∑ + + j i e k f i = p d d ∈ ∈ j H k H j i i n 1 Preemption from tasks Preemption form the Execution of a tasks that can hit more task under test That can hit only once than once (with period (with period greater than less that d i ) d i ) Compare effective utilization against bound, U(n). n = num(H n ) + 1 num(H n ) = the number of tasks in the set H n 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 = H n =H 1 = { }. C + + ≤ 3 f 3 = 0 0 U ( 1 ) T 3 Note that utilization bound is U(1): num( H n ) = 0. Plugging in numbers: C 60 = = < f 3 = 3 0 . 3 1 . 0 T 200 3 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 }; H n = {}; H 1 = { τ 3 }. C 1 ∑ + + k ≤ 1 f 1 = 0 C U ( 1 ) T T = k 3 1 1 Note that utilization bound is U(1): num( Hn ) = 0. Plugging in the numbers: C C 20 60 + T = + = < 1 3 f 1 = 0 . 800 1 . 0 100 100 T 1 1 6 Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority: τ 2 For τ 2 : H={ τ 1 , τ 3 }; H n ={ τ 1 }; H 1 ={ τ 3 }; C C 1 ∑ ∑ = + + ≤ j f 2 C U ( 2 ) 2 k T T T = = j 1 k 3 j 2 2 Note that utilization bound is U(2): num( H n ) = 1. Plugging in the numbers: 20 40 60 C C C = + + = + + = > f 1 2 3 0 . 867 0 . 828 2 T T T 100 150 150 1 2 3 7 Real-time Systems Lab, Computer Science and Engineering, ASU
UB Test with Interrupt Priority: For τ 4 : H={ τ 1 , τ 2 , τ 3 }; H n ={ τ 1 , τ 2 , τ 3 }; H 1 ={}; C = ∑ C + + ≤ j 4 f 0 U ( 4 ) 4 T T = j 1 , 2 , 3 j 4 Note that utilization bound is U(4): num( H n ) = 3. Plugging in the numbers: C C C C = + + + 1 2 3 4 f 4 T T T T 1 2 3 4 20 40 60 60 = + + + = > 0 . 882 0 . 756 100 150 200 350 8 Real-time Systems Lab, Computer Science and Engineering, ASU
Supplementary Slides Real-time Systems Lab, Computer Science and Engineering, ASU
Recommend
More recommend