quantifying the sub-optimality of uniprocessor fixed priority non-pre-emptive scheduling

21
Quantifying the sub- optimality of uniprocessor fixed priority non-pre- emptive scheduling Robert Davis 1 , Laurent George 2 , Pierre Courbin 3 1 Real-Time Systems Research Group, University of York 2 AOSTE Team, INRIA 3 Ecole Centrale d’Electronique de Paris (ECE)

Upload: hamal

Post on 21-Mar-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Quantifying the sub-optimality of uniprocessor fixed priority non-pre-emptive scheduling. Robert Davis 1 , Laurent George 2 , Pierre Courbin 3 1 Real-Time Systems Research Group, University of York 2 AOSTE Team, INRIA 3 Ecole Centrale d’Electronique de Paris (ECE). Speedup factors. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Quantifying the sub-optimality of uniprocessor

fixed priority non-pre-emptive scheduling

Robert Davis1, Laurent George2, Pierre Courbin3

1Real-Time Systems Research Group, University of York2AOSTE Team, INRIA3Ecole Centrale d’Electronique de Paris (ECE)

Page 2: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factors QUESTION:

What is the speedup factor by which the processing speed of a single processor would need to be increased, so that any taskset that was previously schedulable according to some optimal scheduling algorithm, can be scheduled using fixed priority scheduling, assuming optimal priority assignment?

Page 3: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Problem scope Single processor systems

Non-pre-emptive scheduling Execution time of all tasks scales linearly with processor

speed Sporadic task model

Static set of n tasks i with priorities 1..n Bounded worst-case execution time Ci

Sporadic/periodic arrivals: minimum inter-arrival time Ti

Relative deadline Di

Utilisation Ui=Ci /Ti

Independent execution Arrivals are independent and unknown a priori (non-concrete)

Page 4: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Background Feasibility and Optimality

A taskset is said to be feasible if there exists some scheduling algorithm that can schedule the taskset without missing as deadline

A scheduling algorithm is said to be optimal if it can schedule all feasible tasksets

EDF-P is optimal Dertouzos (1974), proved that EDF-P is an optimal

uniprocessor pre-emptive scheduling algorithm for arbitrary-deadline tasksets that comply with the sporadic task model

EDF-P can schedule all feasible tasksets that comply with our model

We have previously used a comparison with EDF-P to determine speedup factors for FP-P scheduling

Page 5: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Background Non-pre-emptive

No work-conserving non-pre-emptive algorithm is optimal. Inserted idle time is necessary for optimality amongst non-pre-emptive algorithms.

No optimal on-line inserted idle time algorithm can exist (Howell and Venkatra, 1995). Clairvoyance is also necessary for optimality.

EDF-NP EDF-NP is optimal in the weak sense that it can

schedule any taskset for which a feasible work-conserving non-pre-emptive schedule exists (George et al. 1995)

We can use a comparison with EDF-NP to determine the speedup factor for FP-NP scheduling

Page 6: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Background FP scheduling: Optimal Priority Assignment

A priority assignment policy Q is said to be optimal if there are no tasksets that are schedulable using some other priority assignment policy P which are not also schedulable using policy Q.

FP-P Optimal priority assignment Implicit-deadline tasksets – Rate-Monotonic (Liu & Layland,

1973) Constrained-deadline tasksets – Deadline Monotonic (Leung

& Whitehead, 1982) Arbitrary-deadline tasksets – Optimal Priority Assignment

algorithm, (Audsley, 1993) FP-NP Optimal priority assignment

All 3 cases – OPA algorithm, i.e. Audsley’s algorithm, (George et al., 1995)

Page 7: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Previous results for FP-P

Taskset Constraints[Priority ordering]

Speedup factorLower bound Upper bound

References

Implicit-deadline[Rate Monotonic]

1/ln(2) ≈ 1.44269

(Dertouzos, 1974) /

(Liu & Layland, 1973)

Constrained-deadline[Deadline Monotonic]

1/Ω ≈ 1.76322

(Davis et al., 2009a)

Arbitrary-deadline[OPA]

1/Ω ≈ 1.76322

2 (Davis et al., 2009b)

Speedup factor: increase in processing speed required so that any feasible taskset (schedulable by an optimal scheduling algorithm) can be scheduled using FP-P scheduling

Page 8: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor Definition #1

Let be the lowest processor speed such that a taskset is schedulable according to an optimal algorithmSimilarly is the lowest speed assuming algorithm A

Speedup factor is given by:

Speedup factor is the maximum factor by which it is necessary to increase the processor speed so that any taskset that was schedulable under EDF-NP becomes schedulable under FP-NP.

)(OPTf

Af)(Af

)(/)(max

OPTAA fff

Page 9: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor Definition #2

Let S be some arbitrary taskset, and is the maximum factor by which the execution times of the tasks in S can be scaled and remain schedulable under FP-NP. Similarly, let be the maximum scaling factor under EDF-NP then the speedup factor for taskset S is

The speedup factor for FP-NP is the maximum such factor for any taskset

A taskset is said to be speedup-optimal if it requires the (maximum) speedup factor.

)(SNPFP

)(SNPEDF

)(/)()( SSSf NPFPNPEDFNPFP

Page 10: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Example

Taskset parameters

DAFP-NP schedule

τDτDTA1

Task Ci Di = Ti

τA 1 6

τB 1 7

τC 1 8

τD 3+∆ ∞

2 3 TB TC

DB DC DD

τCτD τBτA τCτBτA τCτD τBτB τA τCτA

Scaling factors

Speedup factor for this taskset=

)5/6()(SNPFP

EDF-NP schedule

τCτD τBτB τA τCτA

6/8)( SNPEDF

)9/10(

Page 11: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: Lower bound

Taskset parameters

D1FP-NP schedule

T1

Task Ci Di = Ti

τi

τn X+∆ ∞

T2T3

D2 D3 Dn

Scaling factor

)1(1

n

)1()1(1

niX

X εε ε εε ε ε ε ε ε ε εX εε ε εε ε ε ε ε ε ε ε

11

1)(0

X

XSNPFP

Page 12: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: Lower bound Taskset is a modified version of the speedup

optimal taskset for the pre-emptive case Tasks 1 to n-1 same as the pre-emptive case (Davis et al,

2009a) Lowest priority task now has an infinite deadline (as well

as an infinite period), so the taskset has implicit deadlines Lowest priority task causes blocking Task at priority n-1 constrains the scaling factors

Priority assignment Need to show that no priority ordering can lead to

schedulability with a larger scaling factor – argument based on the operation of Audsley’s OPA algorithm is given in the paper.

Page 13: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Scaling factor for EDF-NP Two key conditions limit the scaling factor:

1. The first job of every task must complete by the deadline of task n-1:

2. Utilisation of the scaled taskset must not exceed 100%

Utilisation given by:

This is a left Riemann sum of y=1/z over [(1+X), (2+X)] Limit as n→∞ is given by the integral:

Hence:

XXSNPEDF

12)(

)111(

1)1(

11

1

niXn

Un

i

XXdz

zU

X

X

n

12ln12

1

XXSNPEDF

12ln/1)(

Page 14: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

11.11.21.31.41.51.61.71.81.9

22.12.22.32.42.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9X

Scal

ing

fact

or

11.11.21.31.41.51.61.71.81.9

22.12.22.32.42.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9X

Scal

ing

fact

or

11.11.21.31.41.51.61.71.81.9

22.12.22.32.42.5

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9X

Scal

ing

fact

or

a1(X)a2(X)

Scaling factor for EDF-NP Intersection of the lines

as ε→0 similar to the transcendental equation: ln(1/Ω) = Ω defining the mathematical constant Ω ≈ 0.567143

Proof of schedulability with this scaling factor is required - given in the paper

Maximum value where a1(X) = a2(X)

XX

XX

12ln/1

12

76322.1)/1()( SNPEDF

Page 15: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: Lower bound Scaling factor for EDF-NP

Scaling factor for FP-NP

Lower bound on the Speedup factor for FP-NP scheduling:

Note the taskset has implicit deadlines, so this lower bound applies to implicit, constrained and arbitrary deadline tasksets

76322.1)/1()( SNPEDF

11

1)(0

X

XSNPFP

)/1(

1)/1(

)()(

SSf NPFP

NPEDFNPFP

Page 16: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: Upper bound

Let S be any taskset that is schedulable under EDF-NP on a processor of speed 1

As the taskset is schedulable, then at time t=2Dk:

Now consider taskset S scheduled on a processor of speed 2 using FP-NP scheduling, and that the tasks are indexed in Deadline Monotonic priority order

From above:

ki

n

i i

ikk DC

TDD

DB 212

,0max)2(1

i

klepi i

ikk C

TDD

DB)(

12

,0max)2( kikhpi i

ik DCT

DD

)(

12

,0max

Page 17: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: Upper bound

1st two terms , blocking factor for FP-NP scheduling(detail given in the paper)

Sum term can also be substituted, noting that and Formed a sufficient schedulability test for task k under FP-NP (repeating for each k shows the taskset is schedulable)Upper Bound on Speedup factor for FP-NP is therefore 2Holds for tasks with arbitrary deadlines and hence also for implicit and constrained deadline tasksets

i

klepi i

ikk C

TDD

DB)(

12

,0max)2(

kB

kB

xx 1ki DDkhpi )(

ikhpi i

ik CT

DD

)(1

2,0max kDikhpi i

k CTD

)(

Page 18: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

1.76322

1.2

1.3

1.4

1.5

1.6

1.7

1.8

0 100 200 300 400Number of tasks

Spee

dup

fact

or fo

r FP

-NP

Empirical verification1.76322

1.2

1.3

1.4

1.5

1.6

1.7

1.8

0 100 200 300 400Number of tasks

Spee

dup

fact

or fo

r FP-

NP

1.76322

1.2

1.3

1.4

1.5

1.6

1.7

1.8

0 100 200 300 400Number of tasks

Spee

dup

fact

or fo

r FP

-NP

Lower BoundSpeedup factor (Empirical value)Empirical Maxima

Verified using integer values for task parametersUsing exact analysis for FP-NP and EDF-NP schedulingSaw-tooth is an artefact due to quantisation of speedup factors due to use of integers

Page 19: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Speedup factor: SummarySpeedup factor: increase in processing speed required so that any feasible taskset (schedulable by an optimal algorithm) can be scheduled using Fixed Priority schedulingTaskset Constraints[Priority ordering]

FP-PSpeedup factor

Lower bound Upper bound

Implicit-deadline[RM] [OPA]

1/ln(2) ≈ 1.44269

Constrained-deadline[DM] [OPA]

1/Ω ≈ 1.76322

Arbitrary-deadline[OPA] [OPA]

1/Ω ≈ 1.76322

2

FP-NPSpeedup factor

Lower bound Upper bound

1/Ω ≈ 1.76322

2

1/Ω ≈ 1.76322

2

1/Ω ≈ 1.76322

2

Page 20: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Future work / open questions Determining exact speedup factors for FP-NP,

and for FP-P with arbitrary deadline tasksets

These are where optimal priority assignment requires Audsley’s OPA algorithm – complicates proof of speedup optimal taskset attributes

Determining the exact speedup factor as a function of the number of tasks

Empirical investigation Try to find tasksets that require a speedup factor >

1/Ω Is 1/Ω ultimately the limit ???

Page 21: Quantifying the sub-optimality of uniprocessor fixed priority  non-pre-emptive  scheduling

Questions[1] R.I. Davis, T. Rothvoß, S.K. Baruah, A. Burns “Exact Quantification of the Sub-optimality of Uniprocessor Fixed Priority Pre-emptive Scheduling”. Real-Time Systems, Volume 43, Number 3, pages 211-258, November 2009. (Published online 17th July 2009). Gives the Exact speedup factor for implicit- and constrained-deadline tasksets (pre-emptive scheduling)[2] R.I. Davis, T. Rothvoß, S.K. Baruah, A. Burns “Quantifying the Sub-optimality of Uniprocessor Fixed Priority Pre-emptive Scheduling for Sporadic Tasksets with Arbitrary Deadlines”. RTNS’09, October 26-27th, 2009. Gives upper and lower bounds for arbitrary-deadline tasksets (pre-emptive scheduling)[3] R.I. Davis, L. George, P. Courbin “Quantifying the Sub-optimality of Uniprocessor Fixed Priority Non-pre-emptive Scheduling”. RTNS’10, November 4-5th, 2010. Gives upper and lower bounds for implicit, constrained, and arbitrary-deadline tasksets (non-pre-emptive scheduling)