and Configuration Selection Tei-Wei Kuo Embedded Systems and - - PowerPoint PPT Presentation

and configuration selection
SMART_READER_LITE
LIVE PREVIEW

and Configuration Selection Tei-Wei Kuo Embedded Systems and - - PowerPoint PPT Presentation

Efficient On-Line Schedulability Tests and Configuration Selection Tei-Wei Kuo Embedded Systems and Wireless Networking Laboratory Dept of Computer Science and Info. Engr. National Taiwan University Taipei, Taiwan Contents Motivation


slide-1
SLIDE 1

Efficient On-Line Schedulability Tests and Configuration Selection

Tei-Wei Kuo

Embedded Systems and Wireless Networking Laboratory Dept of Computer Science and Info. Engr. National Taiwan University Taipei, Taiwan

slide-2
SLIDE 2

Contents

  • Motivation
  • Configuration Selection
  • Schedulability Test for the

Liu&Layland Model

  • Schedulability Test for the

Multiframe Model

  • Performance Evaluation
  • Conclusion
slide-3
SLIDE 3

Motivation

 In there a systematic way in

selecting a better configuration for processes?

 If overload is detected, what should

we do?

 How to schedule processes whose

timing constraints change in reaction to the environment?

slide-4
SLIDE 4

What to do when overload is detected?

Graceful Degradation! But how?

 Load Shedding – kill less important processes!  Relax timing constraint briefly!

E.g., instead of processing a sporadic interrupt

within 5 seconds, promise to process 2 interrupts within 10 seconds!

Time 5 10 Time 5 10

slide-5
SLIDE 5

Another thought in relaxing timing constraints!

 Load Scaling

Unschedulable configurations

{(tA, 1.5, 3), (tB, 2, 4)} {(tA, 1.5, 3), (tB, 2.5, 5)}

Schedulable configurations

{(tA, 1.5, 3), (tB, 3, 6)} Furthermore, {(tA, 1.5, 3), (tB, 1.5, 3)}

tA and tB become schedulable when their

periods are harmonically related!!

slide-6
SLIDE 6

Questions: How to choose periods?

 Configuration Selection Problem:

Given a set of configurations, choose

a schedulable configuration!

Period Assignment Problem:

Given a set of adaptive processes,

choose a schedulable configuration!

  • An adaptive process may change

its timing constraints!

slide-7
SLIDE 7

Introduction

  • Needs of Schedulability Tests
  • Performance Guarantee
  • Resource Reservation
  • Open System Architecture
  • etc
  • Approaches:
  • Achievable Utilization Factor
  • Rate Monotonic Analysis (RMA)
slide-8
SLIDE 8

Introduction

  • A Sufficient Schedulability Condition
  • Liu & Layland

(n = process #)

  • Kuo & Mok

(k = fundamental frequency #)

  • Mok & Chen

(r = min (ci

0/ci 1))

  • and various tests by Han, et al.
  • Sufficient and Necessary Schedulability

Conditions

  • Rate Monotonic Analysis (RMA)

) 1 2 (

1

n

n

) 1 2 (

1

k

k

) 1 ) 1 (( *

1

 

n

r r n r

slide-9
SLIDE 9

Introduction

  • Motivation
  • On-line schedulability tests
  • Better precision

15 60 3 5

t1 t2 t3 t4

(ci, pi) (1,3) U1=0.333 (1,5) U2=0.533 (2,15) U3=0.666 (8,60) U4=0.8 Op 1 (r=1.875) p1’ = 1.875 U1=0.533 p2’ = 3.75 U2=0.8 p3’ = 15 U3=0.933 p4’ = 60 U4=1.066 Op 2 (r=2.5) p1’ = 2.5 U1=0.4 p2’ = 5 U2=0.6 p3’ =10 U3=0.8 p4’ = 40 U4=1.0 Op 3 (r=3) p1’ = 3 U1=0.333 p2’ = 3 U2=0.666 p3’ = 12 U3=0.833 p4’ = 48 U4=1.0

Han-Tyan Kuo-Mok

) 1 2 (

1

k

k

 

1 2

/ ( log

2 '

p p i

i

r p  

slide-10
SLIDE 10

Our Approach

  • Exploit the harmonic relationship of

task periods to improve existing schedulability tests:

  • Liu & Layland Process Model
  • Multiframe Process Model
  • Efficient for on-line implementation.
  • Effective for heavy CPU utilizations!
slide-11
SLIDE 11

Definitions

  • Critical Instant
  • Critical Interval
  • Utilization Factor
  • Division Graph
  • Root

t3:15 t1:3 t4:20 t2:5

n i i i

p c U

1

slide-12
SLIDE 12

Definitions

  • Offspring Set

e.g., {t1, t2, t4} and {t1, t2, t3, t4, t5} are

  • ffspring sets of t5.
  • Reduced Set and RS-Representative

A process t is a RS-representative of a set

{t1, t2, t3} if the period of t

is 15, and the utilization factor is equal to the sum of the utilization factors of t1, t2, and t3 . {t1, t2, t3} is a reduced set of t .

t3:15 t5:60 t1:3 t4:20 t2:5

slide-13
SLIDE 13

Schedulability Tests for the Liu&Layland Model

 Computing the smallest harmonic

base

Definition: Division Graph

An irreflexive, asymmetric, transitive,

acyclic directed graph to represent the divisibility relation among a set of real numbers

Theorem 9 [KM:97] Given a set of n

processes, there exists a corresponding division graph G. If K is the minimum number that G can be decomposed into vertex-disjoint linear paths, then its least upper bound of utilization factor is K(21/K-1).

t3:15 t5:60 t1:3 t4:20 t2:5

slide-14
SLIDE 14

Schedulability Tests for the Liu&Layland Model

 Definition: Minimum

Linear Covering [KM:97] – Given an acyclic directed graph G, the problem is to find the smallest integer K such that the vertices of G are partitioned into K vertex- disjoint linear paths. K is the minimum linear covering number of G.

An O(N5/2) Algorithm S 7 14 42 6 12 24 5 10 20 60 7 14 42 6 12 24 5 10 20 60 T

slide-15
SLIDE 15

Schedulability Tests for the Liu&Layland Model More Precise Schedulability Tests?

slide-16
SLIDE 16

Schedulability Tests for the Liu&Layland Model

  • Theorem 1 [Lehoczky, Sha, Ding 89]

Process ti in a set of periodic processes scheduled by a fixed-priority-driven preemptive scheduling algorithm will always meets its deadline for all processes phases if and only if there exists a pair (k,m) in Ri such that where

k i i j j k j

mp c p mp c          

) (

} , , 2 , 1 , 1 | ) , {(          

k i i

p p m i k m k R 

slide-17
SLIDE 17

Schedulability Tests for the Liu&Layland Model

  • Lemma 1

Suppose that Ti-1 is schedulable. Let tj be any process in Ti, TOj a subset of an offspring set of tj in Ti which includes tj, and t the RS-representative of TOj. Let process t’ be the process with the largest period in (Ti – TOj {t}), where the period and computation requirements of t’ are pi and c, respectively. If there exists a pair such that where , then Ti (including ti) is schedulable.

    

       

}) { } { (

) (

t t t

j i x

TO T k x k x

mp c p mp c

} , , 2 , 1 }), { ( | ) , {(            

k i j i k

p p m TO T m k R  t t

R m k   ) , (

slide-18
SLIDE 18

Schedulability Tests for the Liu&Layland Model

  • Theorem 2

Suppose that Ti-1 is schedulable, and STi is a non-empty subset of Ti. For each process tj in STi, let TOj be a subset of an offspring set of tj in Ti such that TOj  STi = {tj}, and TOj  TOk = {} for any two distinct processes tj and tk in STi. For each process tj in STi, t’j is the RS- representative of TOj. Let process t’ be the process with the largest period in where the period and the computation requirements of t’ are pi and c,

  • respectively. If there exists a pair such that

where then Ti is schedulable.

}) every for ,

  • f

tive representa

  • RS

the is | { (

i j j j j j ST j i i

ST TO TO T T

i

     

t t t   R m k   ) , (

k x k T x

mp c p mp c

i x

       

   

) (

}) { ( t t

} p p , 2, 1, m , | ) , {(

k i 

          

i k

T m k R t

slide-19
SLIDE 19

Schedulability Tests for the Liu&Layland Model

  • Theorem 3 [Liu&Layland 73]

A set of n periodic processes is schedulable if the total utilization factor of the process set is no larger than

  • Theorem 4

Suppose that Ti-1 is schedulable. Let k be the number of roots in Ti. If the total utilization factor of Ti is no larger than then Ti is schedulable.

) 1 2 (

1

n

n

) 1 2 (

1

k

k

slide-20
SLIDE 20

A Schedulability Test Algorithm

 Step 1: i = 1;  Step 2: If there are K roots in Ti

and Ui K(21/K-1), Then ti is schedulable Else the schedulability of ti is not guaranteed; Exit;

 Step 3: i = i + 1;  Step 4: Goto Step 1 unless i > n;

Complexity: O(n2)

slide-21
SLIDE 21

Schedulability Tests for the Liu&Layland Model

Example : F(1) = 1 F(2) = 0.8284 F(3) = 0.7798 F(4) = 0.7568 F(5) = 0.7435

  • Theorem 5 [Kuo&Mok 91]

A set of periodic processes with k fundamental frequencies is schedulable if the total utilization factor of the process set is no larger than

) 1 2 (

1

k

k

15 60 3 20 5

) 1 2 ( ) (

1

 

n

n n F

slide-22
SLIDE 22

Extension: Multiframe Model

 Why the Multiframe model?

Modeling of processes with varying

timing constraints!

Modeling of processes with skipping

  • f process executions in consecutive

periods.

 Goal:

Extend the idea of reduced-set-based

schedulability tests to the multiframe model to have a more precise test!

slide-23
SLIDE 23

Schedulability Tests for the Multiframe Model

  • Definition [Mok and Chen 96]

– Multiframe Process A multiframe real-time process ti is a tuple (Gi,pi), where Gi is an array of Ni execution times (c0

i, c1 i, …, cNi-1 i) for some Ni  1, and pi is the period of ti.

– Remark :

Let c0

i be the maximum in an array of execution times

(c0

i, c1 i, …, cNi-1 i) . c0 i is called the peak execution time of ti .

– AM Multiframe Process

An array (c0

i, c1 i, …, cNi-1 i) is said to be AM (Accumulative

Monotonic) if A multiframe process ti = {Gi= (c0

i, c1 i, …, cNi-1 i),pi} is said to be AM if

its array of execution times is AM .

) 1 ( 1 ), 1 (N x ,1

i mod mod

      

   i j x x k N k i j k N k i

N j C C

i i

slide-24
SLIDE 24

Schedulability Tests for the Multiframe Model

  • Critical Instance of AM Multiframe Process

[Mok&Chen 96]

The critical instance of an AM multiframe process is the beginning of the period when its peak execution time is requested simultaneously with the peak execution times of all higher priority processes.

slide-25
SLIDE 25

Schedulability Tests for the Multiframe Model

  • Reduced Set and RS-Representative of AM Multiframe Process

Suppose that t = {G= (c0, c1, …, cN-1), p} is a multiframe periodic process with period p and an array G of computation requirements. A set of n AM multiframe periodic processes {t1, t2, …, tn}, where process ti has period pi and an array Gi= (c0

i, c1 i, …, cNi-1 i) of

Ni computation requirements, is a reduced set of t if t is called the RS-representative of the reduced set.

i n i i

p p p p

1

max , |

) (

i

N LCM N 

 

   

n i p p k N k p p j i j

i i i

C C

1 1 ) ( mod ) ) ( (

) (

slide-26
SLIDE 26

Schedulability Tests for the Multiframe Model

// // // Time Time Time

t = {(6,6,5), 6} t1= {(2,1,1), 3} t2= {(3), 6}

  • Claim 1: The RS-representative of a set of AM multiframe

periodic processes is an AM multiframe periodic process.

slide-27
SLIDE 27

Schedulability Tests for the Multiframe Model

  • Theorem 6 [Mok&Chen 96]

For the preemptive fixed priority scheduling policy, an AM multiframe process is schedulable if it is schedulable at its critical instance

  • Theorem 7

Process ti in a set of AM multiframe periodic processes scheduled by a fixed priority-driven preemptive scheduling algorithm will always meet its deadline for all process phases iff there exists a pair (k,m)  Ri such that where

 

          

 

i j p mp x k i N x j

j k j

mp C C

1 mod

) (

} , , 2 , 1 , 1 | ) , {(          

k i i

p p m i k m k R 

slide-28
SLIDE 28

Schedulability Tests for the Multiframe Model

  • Lemma 2

Suppose that the AM multiframe process set Ti-1 is schedulable. Let tj be any multiframe process in Ti, TOj any subset of an

  • ffspring set of tj, and tj = {(c0, c1, …, cN-1), p} the RS-

representative of TOj. Let process t’ be the process with the largest period in (Ti - TOj{t}), where the period and the array computation requirements of t’ are pi and G’ = (c’0, c’1, …,

c’N’-1) , respectively. If there exists a pair

(k, m)  R’ such that where , then AM multiframe process set Ti is schedulable.

 

            

  

}) { } { ( 1 mod

) (

t t t

j i x x k x

TO T p mp y k N y x

mp C C

} , , 2 , 1 }), { ( | ) , {(            

k i j i k

p p m TO T m k R  t t

slide-29
SLIDE 29

Schedulability Tests for the Multiframe Model

  • Theorem 8

Suppose that the AM multiframe process set Ti-1 is schedulable, and STi is a non-empty subset of the AM multiframe process set Ti. For each process tj  Ti, let TOj be a subset of an offspring set of tj in Ti such that TOj  STi= {tj}, and TOj  TOk = {} for any two distinct processes tj and tk in STi. For each process tj  STi, t’j is the RS-representative of TOj. Let process t’ be the process with the largest period in where the period and the array of computation requirements of t’ are pi and G’ = (c’0, c’1, …, c’N’-1) , respectively. If there exists a pair (k, m)  R’ such that where then Ti is schedulable.

}) every for ,

  • f

tive representa

  • RS

the is | { (

i j j j j j ST j i i

ST TO TO T T

i

     

t t t  

k T p mp y N y x

mp C C

i x x k x

  

 

            } { ( 1 mod

) (

t t

} p p , 2, 1, m , | ) , {(

k i 

          

i k

T m k R t

slide-30
SLIDE 30

Schedulability Tests for the Multiframe Model

  • Definition: Peak Utilization Factor

The peak utilization factor Um of an AM multiframe process set T = {t1, …, tn} is equal to where c0

i and pi are the peak execution time and period of

ti, respectively.

  • Theorem 9 [Mok&Chen96]

Let . For process sets of size n, the bound on peak utilization factor is given by

 

n i i i

p c

1

) ( min

1 1 i i n i

C C r

 ) 1 1 (

1

   

n

r r n r

slide-31
SLIDE 31

Schedulability Tests for the Multiframe Model

  • Theorem 10

Suppose that Ti-1 is schedulable. Let k be the number of roots in

  • Ti. If the total peak utilization factor of Ti is no larger than

then Ti is schedulable, where r is calculated based on the RS- representative set of Ti.

  • Remark :

There is no way to directly compare the bounds on the peak utilization factors derived by Theorems 9 and 10 because r might be different in the original and transformed process sets.

) 1 1 (

1

   

k

r r k r

slide-32
SLIDE 32

Performance Evaluation

  • Polynomial-Time Schedulability Tests under Comparison:
  • Liu&Layland Model
  • Liu & Layland 73

(n = process #)

  • Kuo & Mok 91

(k = fundamental frequency #)

  • Han & Tyan 97 (DCT+Sr)
  • Root/Reduced-Set Method
  • Multiframe Model
  • Mok & Chen 96

(r = min (ci

0/ci 1))

  • Han & Tyan 98 (DCT+Sr)
  • Root/Reduced-Set Method
slide-33
SLIDE 33

Performance Evaluation

  • Performance Metrics
  • Guarantee Ratio:
  • Data Sets
  • Number of processes per process set: randomly chosen

between 10 and 30.

  • Fundamental frequencies:
  • 1/4 ~ 1/10 of the number of processes.
  • Probability of assigning i fundamental frequencies to a

process is (1/2)i-1. Random assignment!

  • Utilization factor ranges from 70% ~ 95%.
  • 70% ~ 110% for multiframe process sets.
  • Cj

i=C0 i / rj i for ri in (2, 5), for each multiframe process ti.

  • 400 process sets per utilization factor were tested

sets) process

  • f

(number sets) process e schedulabl guarantee

  • f

(number

slide-34
SLIDE 34

Liu&Layland Model

slide-35
SLIDE 35

Multiframe Model

When r  (2, 5) !

slide-36
SLIDE 36

Multiframe Model

When r  (2, 10)!

slide-37
SLIDE 37

Conclusion

  • Summary
  • Provides efficient on-line schedulability tests which

consider the harmonic relationship of process periods and the variance of computation times in different periods.

  • Provide better precision in identifying schedulable

process sets, even under heavy CPU utilization.

  • Future research
  • Extend the reduced-set methodology to analyze the

schedulability of soft and firm real-time process sets

  • A process set mixed with hard, soft, and firm real-time

processes.

  • Generalize the results to RMA-based schedulability

tests to speed up their performance.