Real-Time Systems: Deriving Utilization Bound for Rate Monotonic Scheduling - Prof. Tarek , Study notes of Computer Science

An exercise on deriving the utilization bound for rate monotonic scheduling in real-time systems. It includes the calculation of the maximum value of a product for a schedulable system and the comparison of the results with the liu and layland bound and the hyperbolic bound. The document also introduces the concept of deadline monotonic scheduling and its schedulability condition.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-n9e
koofers-user-n9e 🇺🇸

8 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Real-Time Systems
Periodic Tasks
Tarek Abdelzaher
Exercise:
Know Your Worst Case Scenario
Consider a periodic system of two tasks
Let Ui= Ci/Pi (for i = 1,2)
What is the maximum value of:
Πi(1-Ui)
for a schedulable system?
Deriving the Utilization Bound
for Rate Monotonic Scheduling
The minimum utilization case:
C1
P1
P2
Task 1
Task 2
1
1
2
21 P
P
P
PC
=
+= 11
1
2
1
2
2
1
P
P
P
P
P
C
U
+= 11
1
2
1
2
1
2
1
2
2
1
P
P
P
P
P
P
P
P
P
P
U
1
1
2=
P
P
=
1
2
1
2
11 P
P
P
P
PC
( )
=
1
2
112 P
P
CPC
Deriving the Utilization Bound
for Rate Monotonic Scheduling
The minimum utilization case:
C1
P1
P2
Task 1
Task 2
1
1
2
21 P
P
P
PC
=
+= 11
1
2
1
2
2
1
P
P
P
P
P
C
U
+= 11
1
2
1
2
1
2
1
2
2
1
P
P
P
P
P
P
P
P
P
P
U
1
1
2=
P
P
=
1
2
1
2
11 P
P
P
P
PC
C1
P1
P2
Task 1
Task 2
C2
Deriving the Utilization Bound
for Rate Monotonic Scheduling
The minimum utilization case:
C1
P1
P2
Task 1
Task 2
1
1
2
21 P
P
P
PC
=
+= 11
1
2
1
2
2
1
P
P
P
P
P
C
U
+= 11
1
2
1
2
1
2
1
2
2
1
P
P
P
P
P
P
P
P
P
P
U
1
1
2=
P
P
=
1
2
1
2
11 P
P
P
P
PC
C1
P1
P2
Task 1
Task 2
C2
112
121
CPP
PCC
=
=
+
Solutions
( )
=+
=
+
=+=+
=
+
=+=+
==
=
ii
U
P
P
P
PC
P
C
U
P
P
P
PC
P
C
U
PPCPC
PPC
21
2
11
11
2
2
1
2
22
2
2
2
1
2
1
11
1
1
1
21112
121
Critically
Schedulable
Schedulable
(
)
+
ii
U21
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Real-Time Systems: Deriving Utilization Bound for Rate Monotonic Scheduling - Prof. Tarek and more Study notes Computer Science in PDF only on Docsity!

Real-Time Systems

Periodic Tasks

Tarek Abdelzaher

Exercise:

Know Your Worst Case Scenario

 Consider a periodic system of two tasks

 Let U

i

= C

i

/P

i

(for i = 1,2)

 What is the maximum value of:

Πi(1-Ui)

for a schedulable system?

Deriving the Utilization Bound

for Rate Monotonic Scheduling

 The minimum utilization case:

C 1

P 1

P 2

Task 1

Task 2

1 1

2 1 2 P P

P C P  

  

 = −

 

  

 − 

  

 = 1 + − 1 1

2

1

2

2

1 P

P

P

P

P

C U

 

  

 − 

  

 − 

  

  

 = 1 + − 1

1

2

1

2

1

2

1

2

2

1

P

P

P

P

P

P

P

P

P

P U

1 1

(^2) =  

  

 ⇒ P

P

 

  

  

  

 = − 1

2 1

1 12 P

P P

P C P

  

 = − 1

2 2 1 1 P

P C P C

Deriving the Utilization Bound

for Rate Monotonic Scheduling

 The minimum utilization case:

C 1

P 1

P 2

Task 1

Task 2

1 1

2 1 2 P P

P C P  

  

 = −

 

  

 − 

  

 = 1 + − 1 1

2

1

2

2

1 P

P

P

P

P

C U

 

  

 − 

  

 − 

  

  

 = 1 + − 1

1

2

1

2

1

2

1

2

2

1

P

P

P

P

P

P

P

P

P

P U

1 1

(^2) =  

  

 ⇒ P

P

 

  

  

  

 = − 1

2 1

1 12 P

P P

P CP

P (^1) C 1

P 2

Task 1

Task 2

C 2

Deriving the Utilization Bound

for Rate Monotonic Scheduling

 The minimum utilization case:

C 1

P 1

P 2

Task 1

Task 2

1 1

2 1 2 P P

P C P  

  

 = −

 

  

 − 

  

 = 1 + − 1 1

2

1

2

2

1 P

P

P

P

P

C U

 

  

− 

  

 − 

 

  

 = 1 + − 1 1

2

1

2

1

2

1

2

2

1

P

P

P

P

P

P

P

P

P

P U

1 1

(^2) =  

  

 ⇒ P

P

 

 

 

  

  

= − 1

2 1

2 (^1 1) P

P P

C PP

C 1

P 1

P 2

Task 1

Task 2

C 2

2 1 1

1 2 1

P P C

C C P

− =

  • =

Solutions

( ) ∏

i i

U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P C P P
C P P

2

1

2

2 2

2

2 2

1

2

1

1 1

1

1 1

2 1 1 1 2

1 2 1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

Solutions

∏ (^ +)=

i i

U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P C P P
C P P

2

1

2

2 2

2

2 2

1

2

1

1 1

1

1 1

2 1 1 1 2

1 2 1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

Solutions

∏ (^ +)=

i i

U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P C P P
C P P

2

1

2

2 2

2

2 2

1

2

1

1 1

1

1 1

2 1 1 1 2

1 2 1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

Solutions

∏ (^ +)=

i i

U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P C P P
C P P

2

1

2

2 2

2

2 2

1

2

1

1 1

1

1 1

2 1 1 1 2

1 2 1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

The General Case

∏ (^ +)= =

i n n

n i

n n

n n

n

n n

i

i

i

i i

i

i i

n n

i i i

P
P
P
P
P
P
P
P
U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P P
C P P

1

2 1

3

1

2

1

1

1

1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

The General Case

∏ (^ +)= =

i n n

n i

n n

n n

n

n n

i

i

i

i i

i

i i

n n

i i i

P
P
P
P
P
P
P
P
U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P P
C P P

1

2 1

3

1

2

1

1

1

1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

The General Case

∏ (^ +)= =

i n n

n i

n n

n n

n

n n

i

i

i

i i

i

i i

n n

i i i

P
P
P
P
P
P
P
P
U
P
P
P
C P
P
C
U
P
P
P
C P
P
C
U
C P P
C P P

1

2 1

3

1

2

1

1

1

1

Critically

Schedulable

Schedulable ∏ i (U^ i+^1 )≤^2

Scheduling Taxonomy

Periodic Task Scheduling

Rate Monotonic EDF

Bound Optimality Bound Optimality

Hyperbolic Bound

Scheduling Taxonomy

Periodic Task Scheduling

Rate Monotonic EDF

Bound Optimality Bound Optimality

Hyperbolic Bound

With

Period=Deadline

Scheduling Taxonomy

Periodic Task Scheduling

Rate Monotonic EDF

With

Deadline < Period

Deadline

Deadline Monotonic Scheduling

 Consider a set of periodic tasks where each

task, i, has a computation time, Ci, a period, Pi,

and a relative deadline Di < Pi.

Pi

Di

Deadline Monotonic Scheduling

 Consider a set of periodic tasks where each

task, i, has a computation time, C

i

, a period, P

i

and a relative deadline D

i

< P

i

 What is the schedulability condition?

Pi

Di

Deadline Monotonic Scheduling

 Consider a set of periodic tasks where each

task, i, has a computation time, C

i

, a period, P

i

and a relative deadline D

i

< P

i

 Schedulability can’t be worse than if Pi was

reduced to Di. Thus:

i

n

i

i

n

D

C

1 /

Pi

Di

Deadline Monotonic Scheduling

 Consider a set of periodic tasks where each

task, i, has a computation time, Ci, a period, Pi,

and a relative deadline Di < Pi.

 Schedulability can’t be worse than if P

i

was

reduced to D

i

. Thus:

∑ ≤^ (^ −)

i

n

i

i

n

D

C

1 /

Pi

Di

Problem?

A Better Condition

 Worst case interference from a higher priority

task, j?

Pi

Di

Pj Cj

A Better Condition

 Worst case interference from a higher priority

task, j?

Pi

Di

Pj Cj

j j

i

C

P

D

A Better Condition

 Worst case interference from a higher priority

task, j?

 Schedulability condition:

Pj Cj

j j

i

C

P

D

i j

j j

i

i C D

P

D

C ≤

Pi

Di

A Better Condition

 Worst case interference from a higher priority

task, j?

 Schedulability condition:

Pj Cj

j j

i

C

P

D

i j

j j

i

i C D

P

D

C ≤

My exec. time

Worst case interference,

From higher priority tasks (^) I ,

My deadline

Pi

Di

A Better Condition

 Worst case interference from a higher priority

task, j?

 Schedulability condition:

Pj Cj

j j

i

C

P

D

i j

j j

i

i C D

P

D

C ≤

My exec. time

Worst case interference,

From higher priority tasks (^) I ,

My deadline

Pi

Di

Problem?

Example

Pj Cj

Pi

Di

Ri Consider a system of two tasks:

Task 1: P 1 =1.7, D 1 =0.5, C 1 =0.

Task 2: P 2 =8, D 2 =3.2, C 2 =

3

  1. 5 1
  2. 7

3

3

  1. 5 1

  2. 7

  3. 5

  4. 5

  5. 5

2

( 2 ) ( 2 ) 2

1 1

( 1 ) ( 2 ) 2

2

( 1 ) ( 1 ) 2

1 1

( 0 ) ( 1 ) 2

2

( 0 ) ( 0 ) 2

1

( 0 )

= + =

=  

  

 ^ = 

  

= + =

=  

  

 ^ = 

  

= + =

= =

R I C

C P

R I

R I C

C P

R I

R I C

I C

i i

j j

i

j

R I C
C
P
R
I

= (^) ∑

Example

Pj Cj

Pi

Di

Ri Consider a system of two tasks:

Task 1: P 1 =1.7, D 1 =0.5, C 1 =0.

Task 2: P 2 =8, D 2 =3.2, C 2 =

3

  1. 5 1
  2. 7

3

3

  1. 5 1

  2. 7

  3. 5

  4. 5

  5. 5

2

( 2 ) ( 2 ) 2

1 1

( 1 ) ( 2 ) 2

2

( 1 ) ( 1 ) 2

1 1

( 0 ) ( 1 ) 2

2

( 0 ) ( 0 ) 2

1

( 0 )

= + =

=  

  

 ^ = 

  

= + =

=  

  

 ^ = 

  

= + =

= =

R I C

C P

R I

R I C

C P

R I

R I C

I C

i i

j j

i

j

R I C
C
P
R
I

= (^) ∑

3 < 3.2  Ok!

EDF and Processor Demand

 Interference is due to only those tasks with

earlier deadlines

Pj Cj

Pi

Di

Ri

Dj

EDF and Processor Demand

 Consider demand on the processor due to tasks whose

deadlines have passed

 Within any time interval, L, the demand must be less

than L.

Pj Cj

Pi

Di D j C L P

L D

i

n

i i

i  ≤ 

∑ = 1

L

The Processor Demand

Schedulability Test for EDF

 Checking the schedulability conditions for all L is not

possible.

Pj Cj

Pi

Di D j C L P

L D

i

n

i (^) i

i (^) ≤  

∑ = 1

L

The Processor Demand

Schedulability Test for EDF

 Checking the schedulability conditions for all L is not

possible.

 Observation 1: Check only within a hyper-period (schedule repeats itself)

Pj Cj

Pi

Di D j C L P

L D

i

n

i (^) i

i (^) ≤  

∑ = 1

L

The Processor Demand

Schedulability Test for EDF

 Checking the schedulability conditions for all L is not

possible.

 Observation 1: Check only within a hyper-period (schedule

repeats itself)

Pj Cj

Pi

Di D j C L P

L D

i

n

i i

i  ≤ 

∑ = 1

L

Least common multiple of

all task periods

The Processor Demand

Schedulability Test for EDF

 Checking the schedulability conditions for all L is not

possible.

 Observation 1: Check only within a hyper-period (schedule

repeats itself afterwards)

 Observation 2: Check only on absolute deadlines

Pj Cj

Pi

Di D j C L P

L D

i

n

i i

i  ≤ 

∑ = 1

L

The Processor Demand

Schedulability Test for EDF

 Checking the schedulability conditions for all L is not

possible.

 Observation 1: Check only within a hyper-period (schedule repeats itself afterwards)

 Observation 2: Check only on absolute deadlines

 Observation 3: If U < 1, Demand is trivially satisfied after some point, L*

C L
P
L D

i

n

i i

i  ≤ 

∑ = 1

Time

Demand

Demand=time

L

=?

The Processor Demand

Schedulability Test for EDF

 Deriving L

* C L
P
L D

i

n

i (^) i

i  ≤ 

∑ = 1

Time

Demand

Demand=time

L

=?

∑ ∑ ∑ = = =

n

i

i i i

n

i

n

i

i i

i i i i

i

i

i

i

i

C tU P D U P

t D P C P

t D

P

t D

P

t D

1 1 1

The Processor Demand

Schedulability Test for EDF

 Deriving L

Time

Demand

Demand=time

L*

∑ ∑ ∑ = = =

n

i

i i i

n

i

n

i

i i

i i i i

i

i

i

i

i

C tU P D U P

t D P C P

t D

P

t D

P

t D

1 1 1

C L
P
L D

i

n

i (^) i

i  ≤ 

∑ = 1

The Processor Demand

Schedulability Test for EDF

 Deriving L

Time

Demand

Demand=time

∑ ∑ ∑ = = =

n

i

i i i

n

i

n

i

i i

i i i i

i

i

i

i

i

C tU P D U P

t D P C P

t D

P

t D

P

t D

1 1 1

U

P DU

LU P DU L L

n

i

n i i i

i

i i i −

  • − = ⇒ =

=

= 1

( )

( ) ,

    • 1

1

L*
C L
P
L D

i

n

i (^) i

i  ≤ 

∑ = 1