An asymptotic 3/2-approximation algorithm for static-priority multiprocessor scheduling of implicit deadline tasks

advertisement
An asymptotic 3/2-approximation
algorithm for static-priority multiprocessor
scheduling of implicit deadline tasks
Andreas Karrenbauer & Thomas Rothvoß
Institute of Mathematics
EPFL, Lausanne
19.02.09
Real-time Scheduling
Given: synchronous tasks τ1 , . . . , τn where task τi
◮ is periodic with period p(τi )
◮ has running time c(τi )
◮ has implicit deadline
W.l.o.g.: Task τi releases job of length c(τi ) at
0, p(τi ), 2p(τi ), . . .
Scheduling policy:
◮ multiprocessor
◮ fixed priority
◮ pre-emptive
Real-time Scheduling
Given: synchronous tasks τ1 , . . . , τn where task τi
◮ is periodic with period p(τi )
◮ has running time c(τi )
◮ has implicit deadline
W.l.o.g.: Task τi releases job of length c(τi ) at
0, p(τi ), 2p(τi ), . . .
Scheduling policy:
◮ multiprocessor
◮ fixed priority
◮ pre-emptive
Definition
u(τ ) =
c(τ )
p(τ )
= utilization of task τ
Example
c(τ1 ) = 1
p(τ1 ) = 2
b
0 1 2 3 4 5 6 7 8 9 10
c(τ2 ) = 2
p(τ2 ) = 5
b
b
Example
Theorem (Liu, Layland ’73)
Optimal priorities:
1
p(τi )
for τi (Rate-monotonic Schedule)
c(τ1 ) = 1
p(τ1 ) = 2
b
0 1 2 3 4 5 6 7 8 9 10
c(τ2 ) = 2
p(τ2 ) = 5
b
b
Example
Theorem (Liu, Layland ’73)
Optimal priorities:
1
p(τi )
for τi (Rate-monotonic Schedule)
c(τ1 ) = 1
p(τ1 ) = 2
b
0 1 2 3 4 5 6 7 8 9 10
c(τ2 ) = 2
p(τ2 ) = 5
b
b
Example
Theorem (Liu, Layland ’73)
Optimal priorities:
1
p(τi )
for τi (Rate-monotonic Schedule)
c(τ1 ) = 1
p(τ1 ) = 2
b
0 1 2 3 4 5 6 7 8 9 10
c(τ2 ) = 2
p(τ2 ) = 5
b
b
Example
Theorem (Liu, Layland ’73)
Optimal priorities:
1
p(τi )
for τi (Rate-monotonic Schedule)
c(τ1 ) = 1
p(τ1 ) = 2
b
b
b
0 1 2 3 4 5 6 7 8 9 10
c(τ2 ) = 2
p(τ2 ) = 5
Theorem (Liu, Layland ’73)
u(S) =
P
τ ∈S
u(τ ) ≤ ln(2) ≈ 0.69 ⇒ RM-schedule feasible
Response times
Definition
Response time r(τi ) of τi := longest time that an instance of
task τi waits for accomplishment
Theorem (Lehoczky et al. ’89)
If p(τ1 ) ≤ ... ≤ p(τn ) then r(τi ) is the smallest value s.t.
X r(τi ) c(τi ) +
c(τj ) ≤ r(τi )
p(τj )
j<i
Tasks are feasible ⇔ ∀i : r(τi ) ≤ p(τi )
Response times
Definition
Response time r(τi ) of τi := longest time that an instance of
task τi waits for accomplishment
Theorem (Lehoczky et al. ’89)
If p(τ1 ) ≤ ... ≤ p(τn ) then r(τi ) is the smallest value s.t.
X r(τi ) c(τi ) +
c(τj ) ≤ r(τi )
p(τj )
j<i
Tasks are feasible ⇔ ∀i : r(τi ) ≤ p(τi )
Theorem (Eisenbrand & R. - RTSS’08)
Unless NP = P response times r(τi ) cannot be approximated
within any constant.
A sufficient feasibility criterium
Observation:
If periods multiples of each other:
Tasks S RM-schedulable ⇔ u(S) ≤ 1 (→ Bin Packing)
A sufficient feasibility criterium
Observation:
If periods multiples of each other:
Tasks S RM-schedulable ⇔ u(S) ≤ 1 (→ Bin Packing)
Lemma (Burchard et al ’95)
For tasks S = {τ1 , . . . , τn } define
S(τi ) = log p(τi ) − ⌊log p(τi )⌋
and
β(S) = max S(τ ) − min S(τ )
τ ∈S
τ ∈S
Then the tasks can be RM-scheduled if
u(S) ≤ 1 − β(S) · ln(2).
A simple First Fit algorithm
First Fit:
1. Sort tasks s.t. 0 ≤ S(τ1 ) ≤ ... ≤ S(τn ) < 1
2. Distribute tasks via First Fit (using u(S) ≤ 1 − β(S) · ln(2)
feasibility criterium)
Lemma
Given periodic tasks S = {τ1 , . . . , τn } and ε > 0.
1
1−α u(S) +
#proc. ≤ n2 + 1ε
(1) Let u(τi ) ≤ α then #proc. ≤
(2) Let u(τi ) ≤
1
2
− ε then
(3) First Fit gives an asymptotic 2-approx.
3.
Known results for multiprocessor case
◮
An asymptotic 7/4-approximation algo [Burchard ’95]
Known results for multiprocessor case
◮
An asymptotic 7/4-approximation algo [Burchard ’95]
◮
An asymptotic PTAS under resource augmentation
[Eisenbrand & R. - ICALP’08]
Known results for multiprocessor case
◮
An asymptotic 7/4-approximation algo [Burchard ’95]
◮
An asymptotic PTAS under resource augmentation
[Eisenbrand & R. - ICALP’08]
◮
There is no asymptotic FPTAS [Eisenbrand & R. ICALP’08]
Known results for multiprocessor case
◮
An asymptotic 7/4-approximation algo [Burchard ’95]
◮
An asymptotic PTAS under resource augmentation
[Eisenbrand & R. - ICALP’08]
◮
There is no asymptotic FPTAS [Eisenbrand & R. ICALP’08]
Theorem (Karrenbauer & R. ’09)
There is an asymptotic 3/2-approximation algorithm for
Multiprocessor Real-time Scheduling with running time O(n3 ).
Using the power of matchings
τ1
τ2
τ3
τ4
Using the power of matchings
τ1
τ3
⇔ {τ1 , τ2 } feasible
τ2
τ4
Using the power of matchings
τ1
1
τ2
1
τ3
1
τ4
Using the power of matchings
w(τ1 ) τ1
1
τ2 w(τ2 )
1
w(τ3 ) τ3
1
τ4 w(τ4 )
#proc. needed to schedule k copies of τ
k→∞
k
w(τ ) = lim
Using the power of matchings
w(τ1 ) τ1
1
τ2 w(τ2 )
1
w(τ3 ) τ3
1
τ4 w(τ4 )
#proc. needed to schedule k copies of τ
k→∞
k
w(τ ) = lim
Using the power of matchings
w(τ1 ) τ1
1 − w(τ1 ) − w(τ2 )
τ2 w(τ2 )
1 − w(τ1 ) − w(τ3 )
w(τ3 ) τ3
1 − w(τ3 ) − w(τ4 )
τ4 w(τ4 )
#proc. needed to schedule k copies of τ
k→∞
k
w(τ ) = lim
Using the power of matchings
τ1
1 − w(τ1 ) − w(τ2 )
τ2
1 − w(τ1 ) − w(τ3 )
τ3
1 − w(τ3 ) − w(τ4 )
τ4
#proc. needed to schedule k copies of τ
k→∞
k
w(τ ) = lim
The vertex costs
w(τ )
1.00
0.75
0.50
b
0.25
0
0.25 0.50 0.75 1.00 u(τ )
#proc. needed to schedule k copies of τ
w(τ ) = lim
k→∞
k

1
1

u(τ ) · 1−u(τ ) u(τ ) ≤ 3
1
1
1
1
=
2
3 < u(τ ) ≤ 2 − 12k


1
1
u(τ ) > 21 − 12k
0
The algorithm
1. Construct G = (S, E) with edges (τ1 , τ2 ) ∈ E ⇔ {τ1 , τ2 }
RM-schedulable. Choose edge costs ce = 1 and vertex costs

1
1

u(τ ) · 1−u(τ ) u(τ ) ≤ 3
1
1
1
w(τ ) = 12
3 < u(τ ) ≤ 2 − 12k


1
1
u(τ ) > 12 − 12k
2. Solve
min{
X
e∈M
c(e) +
X
w(τ ) | M is matching}
τ ∈S\V (M )
3. For all {τ1 , τ2 } ∈ M create a processor with {τ1 , τ2 }
4. Define
◮
◮
◮
1 i
Si = {τ ∈ S\V (M ) | 13 · i−1
k ≤ u(τ ) < 3 · k } ∀i = 1, . . . , k
1
1
1
Sk+1 = {τ ∈ S\V (M ) | 3 ≤ u(τ ) ≤ 2 − 12k
}
1
1
Sk+2 = {τ ∈ S\V (M ) | u(τ ) > 2 − 12k }
5. Distribute S1 , . . . , Sk+2 via First Fit.
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
◮
{τ1 , τ2 } ∈ M ⇒ schedule {τ1 , τ2 } with 1 proc.
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
◮
◮
{τ1 , τ2 } ∈ M ⇒ schedule {τ1 , τ2 } with 1 proc.
τ not covered by M ⇒ need w(τ ) ∈ [0, 1] proc. on average.
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
◮
◮
◮
{τ1 , τ2 } ∈ M ⇒ schedule {τ1 , τ2 } with 1 proc.
τ not covered by M ⇒ need w(τ ) ∈ [0, 1] proc. on average.
To show: ∃ matching solution of cost ( 23 + o(1))OP T
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
◮
◮
◮
◮
{τ1 , τ2 } ∈ M ⇒ schedule {τ1 , τ2 } with 1 proc.
τ not covered by M ⇒ need w(τ ) ∈ [0, 1] proc. on average.
To show: ∃ matching solution of cost ( 23 + o(1))OP T
Let P1 , . . . , Pm optimum solution. Each processor Pi
contributes at most ( 23 + o(1)) to the matching
The analysis
Lemma
The algorithm yields a solution of cost ( 32 + o(1)) · OP T .
◮
Matching M of cost α ⇒ solution with (1 + o(1)) · α
processors
◮
◮
◮
{τ1 , τ2 } ∈ M ⇒ schedule {τ1 , τ2 } with 1 proc.
τ not covered by M ⇒ need w(τ ) ∈ [0, 1] proc. on average.
To show: ∃ matching solution of cost ( 23 + o(1))OP T
◮
Let P1 , . . . , Pm optimum solution. Each processor Pi
contributes at most ( 23 + o(1)) to the matching
◮
Let Pi = {τ1 , . . . , τq } with u(τ1 ) ≥ . . . ≥ u(τq ).
Case split
◮
Case: q = 1. Do not cover task. Contribution: w(τ1 ) ≤ 1
Case split
◮
◮
Case: q = 1. Do not cover task. Contribution: w(τ1 ) ≤ 1
Case: u({τ1 , τ2 }) ≥ 2/3. Add {τ1 , τ2 } to matching. Contr.:
≤3/2
z
}| {
3
1
u(τj ) ·
w(τj ) = 1 +
1+
≤ .
1 − u(τj )
2
j=3
j=3
| {z }
| {z }
q
X
q
X
≤1/3
≤1/3
Case split
◮
◮
Case: q = 1. Do not cover task. Contribution: w(τ1 ) ≤ 1
Case: u({τ1 , τ2 }) ≥ 2/3. Add {τ1 , τ2 } to matching. Contr.:
≤3/2
≤1/3
◮
z
}| {
3
1
u(τj ) ·
w(τj ) = 1 +
1+
≤ .
1 − u(τj )
2
j=3
j=3
| {z }
| {z }
q
X
q
X
Case: u(τ1 ) ≥
1
2
−
1
12k .
≤1/3
Add {τ1 , τ2 } to M . Contr.:
3
2
+ o(1)
Case split
◮
◮
Case: q = 1. Do not cover task. Contribution: w(τ1 ) ≤ 1
Case: u({τ1 , τ2 }) ≥ 2/3. Add {τ1 , τ2 } to matching. Contr.:
≤3/2
z
}| {
3
1
u(τj ) ·
w(τj ) = 1 +
1+
≤ .
1 − u(τj )
2
j=3
j=3
| {z }
| {z }
q
X
q
X
≤1/3
≤1/3
◮
◮
1
Case: u(τ1 ) ≥ 21 − 12k
. Add {τ1 , τ2 } to M . Contr.:
Case: u(τ1 ) ≤ 1/3. Leave tasks uncovered. Contr.:
≤3/2
z
}| {
1
3
u(τj ) ·
w(τj ) =
≤
1 − u(τj )
2
j=1
j=1
| {z }
q
X
q
X
≤1/3
3
2
+ o(1)
Case split
◮
◮
Case: q = 1. Do not cover task. Contribution: w(τ1 ) ≤ 1
Case: u({τ1 , τ2 }) ≥ 2/3. Add {τ1 , τ2 } to matching. Contr.:
≤3/2
z
}| {
3
1
u(τj ) ·
w(τj ) = 1 +
1+
≤ .
1 − u(τj )
2
j=3
j=3
| {z }
| {z }
q
X
q
X
≤1/3
≤1/3
◮
◮
1
Case: u(τ1 ) ≥ 21 − 12k
. Add {τ1 , τ2 } to M . Contr.:
Case: u(τ1 ) ≤ 1/3. Leave tasks uncovered. Contr.:
3
2
+ o(1)
≤3/2
z
}| {
1
3
u(τj ) ·
w(τj ) =
≤
1 − u(τj )
2
j=1
j=1
| {z }
q
X
q
X
≤1/3
◮
Case: u(τ2 ) ≤
Contr.: ≤ 32
1
3
< u(τ1 ) ≤
1
2
−
1
12k .
Leave tasks uncovered.
Average case behavior
Define the waste of a solution as the cumulated ratios of idle
times (= AP X − u(S)).
Theorem (Karrenbauer & R. - ESA’09)
Generate n tasks with
◮
periods arbitrary
◮
draw u(τi ) ∈ [0, 1] uniformly at random.
Then
E[waste of First Fit] ≤ O(n3/4 (log n)3/8 ).
Corollary (Karrenbauer & R. - ESA’09)
Given n tasks S w.r.t. above probability distribution, the best
solution in which at most 2 task share a processor, costs in
expectation at most
u(S) + O(n3/4 (log n)3/8 )
Average case behavior (2)
Corollary (Karrenbauer & R. ’09)
Given n tasks w.r.t. above probability distribution then
E[waste of matching algo] ≤ O(n3/4 (log n)3/8 )
Open problems
◮
Problem: Is there an asymptotic PTAS for Multiprocessor
Real-time scheduling?
Open problems
◮
Problem: Is there an asymptotic PTAS for Multiprocessor
Real-time scheduling?
Thanks for your attention
Download