Dual Priority Scheduling is Not Optimal Pontus Ekberg Uppsala - - PowerPoint PPT Presentation

dual priority scheduling is not optimal
SMART_READER_LITE
LIVE PREVIEW

Dual Priority Scheduling is Not Optimal Pontus Ekberg Uppsala - - PowerPoint PPT Presentation

Dual Priority Scheduling is Not Optimal Pontus Ekberg Uppsala University ECRTS 2019 Stuttgart, Germany Dual priority scheduling? (Euromicro Workshop on Real-Time Systems, 1993) 2 Dual priority scheduling? (Euromicro Workshop on Real-Time


slide-1
SLIDE 1

Dual Priority Scheduling is Not Optimal

Pontus Ekberg

Uppsala University

ECRTS 2019

Stuttgart, Germany

slide-2
SLIDE 2

Dual priority scheduling?

(Euromicro Workshop on Real-Time Systems, 1993)

2

slide-3
SLIDE 3

Dual priority scheduling?

(Euromicro Workshop on Real-Time Systems, 1993)

2

slide-4
SLIDE 4

How does it work?

  • Implicit deadline periodic tasks
  • Single preemptive processor

Assumptions For each task

i

ei pi , assign a phase change point

i

pi two priority levels:

i and i

Confjgurations

i i i i i i i i

pi

i

3

slide-5
SLIDE 5

How does it work?

  • Implicit deadline periodic tasks
  • Single preemptive processor

Assumptions For each task τi = (ei, pi), assign

  • a phase change point δi ∈ {0, . . . , pi}
  • two priority levels: π1

i and π2 i

Confjgurations

i i i i i i i i

pi

i

3

slide-6
SLIDE 6

How does it work?

  • Implicit deadline periodic tasks
  • Single preemptive processor

Assumptions For each task τi = (ei, pi), assign

  • a phase change point δi ∈ {0, . . . , pi}
  • two priority levels: π1

i and π2 i

Confjgurations

i i i i i i i i

pi

i

3

slide-7
SLIDE 7

How does it work?

  • Implicit deadline periodic tasks
  • Single preemptive processor

Assumptions For each task τi = (ei, pi), assign

  • a phase change point δi ∈ {0, . . . , pi}
  • two priority levels: π1

i and π2 i

Confjgurations

i i i i i i i i

pi δi

3

slide-8
SLIDE 8

How does it work?

  • Implicit deadline periodic tasks
  • Single preemptive processor

Assumptions For each task τi = (ei, pi), assign

  • a phase change point δi ∈ {0, . . . , pi}
  • two priority levels: π1

i and π2 i

Confjgurations

π1

i

π1

i

π1

i

π1

i

π2

i

π2

i

π2

i

π2

i

pi δi

3

slide-9
SLIDE 9

Comparing with FP and EDF

FP: suboptimal πi πi Dual prio:

?

π1

i

π1

i

π2

i

π2

i

EDF:

  • ptimal

9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7

4

slide-10
SLIDE 10

Comparing with FP and EDF

FP: suboptimal πi πi Dual prio:

?

π1

i

π1

i

π2

i

π2

i

EDF:

  • ptimal

9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7

4

slide-11
SLIDE 11

Comparing with FP and EDF

FP: suboptimal πi πi Dual prio:

?

π1

i

π1

i

π2

i

π2

i

EDF:

  • ptimal

9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7

4

slide-12
SLIDE 12

Is dual priority scheduling optimal?

Dual priority scheduling is optimal for implicit deadline periodic tasks. Conjecture 1 (Burns and Wellings, 1993) (Sadly not)

5

slide-13
SLIDE 13

Why was this a difficult conjecture?

Find a task set that is feasible (U ), and not dual priority schedulable. Disproving the conjecture

Easy!

Almost all task sets are schedulable Evaluating the schedulability can be very costly But in practice… For every confjguration (setuing of

i , i , i), simulate the

hyper-period until a deadline miss. Schedulability test

6

slide-14
SLIDE 14

Why was this a difficult conjecture?

Find a task set that is

  • feasible (U ⩽ 1), and
  • not dual priority schedulable.

Disproving the conjecture

Easy!

Almost all task sets are schedulable Evaluating the schedulability can be very costly But in practice… For every confjguration (setuing of

i , i , i), simulate the

hyper-period until a deadline miss. Schedulability test

6

slide-15
SLIDE 15

Why was this a difficult conjecture?

Find a task set that is

  • feasible (U ⩽ 1), and
  • not dual priority schedulable.

Disproving the conjecture

Easy!

Almost all task sets are schedulable Evaluating the schedulability can be very costly But in practice… For every confjguration (setuing of

i , i , i), simulate the

hyper-period until a deadline miss. Schedulability test

6

slide-16
SLIDE 16

Why was this a difficult conjecture?

Find a task set that is

  • feasible (U ⩽ 1), and
  • not dual priority schedulable.

Disproving the conjecture

Easy!

  • Almost all task sets are schedulable
  • Evaluating the schedulability can be very costly

But in practice… For every confjguration (setuing of

i , i , i), simulate the

hyper-period until a deadline miss. Schedulability test

6

slide-17
SLIDE 17

Why was this a difficult conjecture?

Find a task set that is

  • feasible (U ⩽ 1), and
  • not dual priority schedulable.

Disproving the conjecture

Easy!

  • Almost all task sets are schedulable
  • Evaluating the schedulability can be very costly

But in practice… For every confjguration (setuing of π1

i , π2 i , δi), simulate the

hyper-period until a deadline miss. Schedulability test

6

slide-18
SLIDE 18

How many configurations are there?

  • All priority levels are unique

⇒ A total of (2n)! permutations

  • Phase change points (δi) are integer

⇒ A total of ∏n

i=1(pi + 1) combinations

Assumptions A task set

n has

n

n i

pi distinct confjgurations.

7

slide-19
SLIDE 19

How many configurations are there?

  • All priority levels are unique

⇒ A total of (2n)! permutations

  • Phase change points (δi) are integer

⇒ A total of ∏n

i=1(pi + 1) combinations

Assumptions A task set T = {τ1, . . . , τn} has (2n)! ×

n

i=1

(pi + 1) distinct confjgurations.

7

slide-20
SLIDE 20

A counterexample

ei pi τ1 8 19 τ2 13 29 τ3 9 151 τ4 14 197 hyper-period: 16 390 597 utilization: ∼ 0.9999971 Not dual priority schedulable #configurations n

n i

pi 728 082 432 000 Simulating the full hyper-period for all confjgurations would take hundreds of years on my computer.

8

slide-21
SLIDE 21

A counterexample

ei pi τ1 8 19 τ2 13 29 τ3 9 151 τ4 14 197 hyper-period: 16 390 597 utilization: ∼ 0.9999971 Not dual priority schedulable #configurations = (2n)! ×

n

i=1

(pi + 1) = 728 082 432 000 Simulating the full hyper-period for all confjgurations would take hundreds of years on my computer.

8

slide-22
SLIDE 22

A counterexample

ei pi τ1 8 19 τ2 13 29 τ3 9 151 τ4 14 197 hyper-period: 16 390 597 utilization: ∼ 0.9999971 Not dual priority schedulable #configurations = (2n)! ×

n

i=1

(pi + 1) = 728 082 432 000 Simulating the full hyper-period for all confjgurations would take hundreds of years on my computer.

8

slide-23
SLIDE 23

The saving grace

Most confjgurations lead to a deadline miss very early. For the previous counterexample, less than %

  • f the hyper-period is simulated on average.

Simulation time is days on an offjce computer.

9

slide-24
SLIDE 24

The saving grace

Most confjgurations lead to a deadline miss very early. For the previous counterexample, less than 0.00019 %

  • f the hyper-period is simulated on average.

Simulation time is days on an offjce computer.

9

slide-25
SLIDE 25

The saving grace

Most confjgurations lead to a deadline miss very early. For the previous counterexample, less than 0.00019 %

  • f the hyper-period is simulated on average.

Simulation time is ∼ 2.5 days on an offjce computer.

9

slide-26
SLIDE 26

Recognizing the needle: RM+RM

#configurations = (2n)! × ∏n

i=1(pi + 1)

A dual priority confjguration is called RM+RM if

1 phase 1 priorities ( i ) are RM 2 phase 2 priorities ( i ) are RM 3 maxi i

mini

i

Defjnition: RM+RM RM+RM is an optimal choice of priorities. Conjecture 2 (George et al., 2014) (Sadly not, even considering only point

1 above) 10

slide-27
SLIDE 27

Recognizing the needle: RM+RM

#configurations = (2n)! × ∏n

i=1(pi + 1)

A dual priority confjguration is called RM+RM if

1 phase 1 priorities ( i ) are RM 2 phase 2 priorities ( i ) are RM 3 maxi i

mini

i

Defjnition: RM+RM RM+RM is an optimal choice of priorities. Conjecture 2 (George et al., 2014) (Sadly not, even considering only point

1 above) 10

slide-28
SLIDE 28

Recognizing the needle: RM+RM

#configurations = (2n)! × ∏n

i=1(pi + 1)

A dual priority confjguration is called RM+RM if

1 phase 1 priorities (π1 i ) are RM 2 phase 2 priorities (π2 i ) are RM 3 maxi{π2 i } ⩽ mini{π1 i }

Defjnition: RM+RM RM+RM is an optimal choice of priorities. Conjecture 2 (George et al., 2014) (Sadly not, even considering only point

1 above) 10

slide-29
SLIDE 29

Recognizing the needle: RM+RM

#configurations = (2n)! × ∏n

i=1(pi + 1)

A dual priority confjguration is called RM+RM if

1 phase 1 priorities (π1 i ) are RM 2 phase 2 priorities (π2 i ) are RM 3 maxi{π2 i } ⩽ mini{π1 i }

Defjnition: RM+RM RM+RM is an optimal choice of priorities. Conjecture 2 (George et al., 2014) (Sadly not, even considering only point

1 above) 10

slide-30
SLIDE 30

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-31
SLIDE 31

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-32
SLIDE 32

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-33
SLIDE 33

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-34
SLIDE 34

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-35
SLIDE 35

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-36
SLIDE 36

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-37
SLIDE 37

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-38
SLIDE 38

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-39
SLIDE 39

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-40
SLIDE 40

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-41
SLIDE 41

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-42
SLIDE 42

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-43
SLIDE 43

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-44
SLIDE 44

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-45
SLIDE 45

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-46
SLIDE 46

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-47
SLIDE 47

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-48
SLIDE 48

Recognizing the needle: FDMS (Fautrel et al., 2018)

#configurations = (2n)! × ∏n

i=1(pi + 1)

FDMS always fjnds optimal phase change points. Conjecture 3 (Fautrel et al., 2018) (Sadly not)

11

slide-49
SLIDE 49

Recognizing the needle

1 Try RM+RM priorities with FDMS 2 If not successful, check confjgurations exhaustively

A simple schedulability analysis strategy Doing

1 is much faster than 2 , and works most of the time. 12

slide-50
SLIDE 50

Where is my haystack?

4 tasks Utilization Periods chosen from the fjrst 100 primes

n i

pi 35 000 000 An ad hoc search space Random task sets were tested from this search space until an unschedulable one was found. Tiis is the breakdown:

# task sets % of explored search space Schedulable with RM+RM using FDMS % Schedulable with other confjgurations % Unschedulable % 13

slide-51
SLIDE 51

Where is my haystack?

  • 4 tasks
  • Utilization ∈ [0.99999, 1]
  • Periods chosen from the fjrst 100 primes
  • ∏n

i=1 pi ⩽ 35 000 000

An ad hoc search space Random task sets were tested from this search space until an unschedulable one was found. Tiis is the breakdown:

# task sets % of explored search space Schedulable with RM+RM using FDMS % Schedulable with other confjgurations % Unschedulable % 13

slide-52
SLIDE 52

Where is my haystack?

  • 4 tasks
  • Utilization ∈ [0.99999, 1]
  • Periods chosen from the fjrst 100 primes
  • ∏n

i=1 pi ⩽ 35 000 000

An ad hoc search space Random task sets were tested from this search space until an unschedulable one was found. Tiis is the breakdown:

# task sets % of explored search space Schedulable with RM+RM using FDMS 129 823 ∼ 99.67% Schedulable with other confjgurations 431 ∼ 0.33% Unschedulable 1 ∼ 0.0008% 13

slide-53
SLIDE 53

So dual priority scheduling is no good?

It took 26 years and evaluating millions of task sets to fjnd a single unschedulable one. Fact But perhaps it behaves worse for larger task sets. To fully exploit the apparent near-optimality we need effj- cient tests and methods for fjnding the right parameters.

14

slide-54
SLIDE 54

So dual priority scheduling is no good?

It took 26 years and evaluating millions of task sets to fjnd a single unschedulable one. Fact But perhaps it behaves worse for larger task sets. To fully exploit the apparent near-optimality we need effj- cient tests and methods for fjnding the right parameters.

14

slide-55
SLIDE 55

So dual priority scheduling is no good?

It took 26 years and evaluating millions of task sets to fjnd a single unschedulable one. Fact But perhaps it behaves worse for larger task sets. To fully exploit the apparent near-optimality we need effj- cient tests and methods for fjnding the right parameters.

14

slide-56
SLIDE 56

So dual priority scheduling is no good?

It took 26 years and evaluating millions of task sets to fjnd a single unschedulable one. Fact But perhaps it behaves worse for larger task sets. To fully exploit the apparent near-optimality we need effj- cient tests and methods for fjnding the right parameters.

14

slide-57
SLIDE 57

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-58
SLIDE 58

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-59
SLIDE 59

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-60
SLIDE 60

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-61
SLIDE 61

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-62
SLIDE 62

Open problems

Can we effjciently determine if there exists a schedulable confjguration? Open problem 1 In PSPACE, no lower bounds known If yes, can we effjciently fjnd it? Open problem 2 Can we effjciently evaluate a given confjguration? Open problem 3 In PSPACE, weakly NP-hard Simulation only works for periodic tasks (George et al., 2014)

15

slide-63
SLIDE 63

Open problems

What is the utilization bound? Open problem 4 Must be in the interval ln Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-64
SLIDE 64

Open problems

What is the utilization bound? Open problem 4 Must be in the interval [ln(2), 1) Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-65
SLIDE 65

Open problems

What is the utilization bound? Open problem 4 Must be in the interval [ln(2), 1) Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-66
SLIDE 66

Open problems

What is the utilization bound? Open problem 4 Must be in the interval [ln(2), 1) Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n = |T| (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-67
SLIDE 67

Open problems

What is the utilization bound? Open problem 4 Must be in the interval [ln(2), 1) Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n = |T| (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-68
SLIDE 68

Open problems

What is the utilization bound? Open problem 4 Must be in the interval [ln(2), 1) Is k-priority scheduling optimal for some constant k? Open problem 5 It is for n-priority scheduling, where n = |T| (Pathan, 2015) What about rational phase change points? Open problem 6 Can’t be brute forced!

16

slide-69
SLIDE 69

What if not all priorities are uniqe?

We need to defjne the tie-breaking rule. Precondition But most of them don’t make sense! Tie number of priority orderings with ties are counted by the Fubini numbers, growing faster than the factorials. Bad news Tie same counterexample remains unchedulable if prior- ities can be shared and FIFO or LIFO is used for ties. Result (Not in the paper)

17

slide-70
SLIDE 70

What if not all priorities are uniqe?

We need to defjne the tie-breaking rule. Precondition But most of them don’t make sense! Tie number of priority orderings with ties are counted by the Fubini numbers, growing faster than the factorials. Bad news Tie same counterexample remains unchedulable if prior- ities can be shared and FIFO or LIFO is used for ties. Result (Not in the paper)

17

slide-71
SLIDE 71

What if not all priorities are uniqe?

We need to defjne the tie-breaking rule. Precondition But most of them don’t make sense! Tie number of priority orderings with ties are counted by the Fubini numbers, growing faster than the factorials. Bad news Tie same counterexample remains unchedulable if prior- ities can be shared and FIFO or LIFO is used for ties. Result (Not in the paper)

17

slide-72
SLIDE 72

What if not all priorities are uniqe?

We need to defjne the tie-breaking rule. Precondition But most of them don’t make sense! Tie number of priority orderings with ties are counted by the Fubini numbers, growing faster than the factorials. Bad news Tie same counterexample remains unchedulable if prior- ities can be shared and FIFO or LIFO is used for ties. Result (Not in the paper)

17

slide-73
SLIDE 73

Special thanks to

Martina Maggio Joël Goossens

?

Artifact evaluators

18

slide-74
SLIDE 74

∀Tiank you! ⋄ ∃Qvestions?