Document 10622896

advertisement
EDF-shedulability of synhronous periodi
task systems is oNP-hard
Friedrih Eisenbrand & Thomas Rothvo
Institute of Mathematis
EPFL, Lausanne
SODA'10
Real-time Sheduling
Given:
Periodi tasks ; : : : ; n with
1
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
Given:
I
1
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
Given:
I
I
1
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
time
(i ; di ; pi)
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
i
0
1st job
time
di
(i ; di ; pi)
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
i
i
0
1st job
di
2nd job
1 pi
1 p i + di
(i ; di ; pi)
time
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
i
i
i
0
1st job
di
2nd job
3rd job
time
1 pi
1 p i + di 2 p i
2 p i + di
(i ; di ; pi)
Real-time Sheduling
Periodi tasks ; : : : ; n with
running time i
(relative) deadline di
period pi
Given:
I
I
I
1
Assumptions:
I di pi (onstrained deadlines)
I Task i releases jobs of length i at z pi and absolute
deadline z pi + di for all z 2 N 0 (synhronous)
Consider:
Earliest-Deadline-First shedule (EDF)
uni-proessor
pre-emptive
Question: Will all jobs meet the deadline?
I
I
I
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
Deadline miss
b
0 1 2 3 4 5 6 7 8 9 10 11 12
2 = 3
d2 = 5; p2 = 6
b
b
time
Example
1 = 2;
d1 = 3; p1 = 4
Deadline miss
b
0 1 2 3 4 5 6 7 8 9 10 11 12
b
b
time
2 = 3
d2 = 5; p2 = 6
Theorem (Dertouzos '74)
EDF is an optimum pre-emptive uni-proessor sheduling poliy.
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
Observation:
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Neessary ondition: 8Q 0 :
n
X
i=1
DBF(i; Q) Q
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Neessary ondition: 8Q 0 :
15
n
X
i=1
DBF(i; Q) Q
10
5
0
Q
0
5
10
15
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Neessary ondition: 8Q 0 :
15
n
X
i=1
DBF(i; Q) Q
10
DBF( ; Q)
1
5
0
Q
0
5
10
15
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Neessary ondition: 8Q 0 :
15
n
X
i=1
DBF(i; Q) Q
10
DBF( ; Q)
DBF( ; Q)
1
5
0
2
Q
0
5
10
15
Demand bound funtion
j
k
In [0; Q℄ exatly Qpidi + 1 jobs of task i have
release time and deadline
k
j
Demand bound funtion: DBF(i ; Q) := Qpidi + 1 i
Observation:
Neessary ondition: 8Q 0 :
15
n
X
i=1
DBF(i; Q) Q
DBF(f ; g; Q)
1
10
DBF( ; Q)
DBF( ; Q)
1
5
0
2
2
Q
0
5
10
15
EDF-shedulability ondition
Theorem (Baruah, Mok & Rosier '90)
,
(f ; : : : ; ng; Q) Q:
Earliest-Deadline-First shedule is feasible
8Q 0 :
DBF
1
EDF-shedulability ondition
Theorem (Baruah, Mok & Rosier '90)
,
(f ; : : : ; ng; Q) Q:
Earliest-Deadline-First shedule is feasible
8Q 0 :
DBF
1
Theorem (Albers & Slomka '04)
poly(n; 1=") one an distinguish
I Feasible: 8Q 0 : DBF (S ; Q) Q
I Very infeasible: 9Q 0 : DBF (S ; Q) > (1 + ") Q
In time
EDF-shedulability ondition
Theorem (Baruah, Mok & Rosier '90)
,
(f ; : : : ; ng; Q) Q:
Earliest-Deadline-First shedule is feasible
8Q 0 :
DBF
1
Theorem (Albers & Slomka '04)
poly(n; 1=") one an distinguish
I Feasible: 8Q 0 : DBF (S ; Q) Q
I Very infeasible: 9Q 0 : DBF (S ; Q) > (1 + ") Q
In time
Open problem:
Complexity status?
EDF-shedulability ondition
Theorem (Baruah, Mok & Rosier '90)
,
(f ; : : : ; ng; Q) Q:
Earliest-Deadline-First shedule is feasible
8Q 0 :
DBF
1
Theorem (Albers & Slomka '04)
poly(n; 1=") one an distinguish
I Feasible: 8Q 0 : DBF (S ; Q) Q
I Very infeasible: 9Q 0 : DBF (S ; Q) > (1 + ") Q
In time
Open problem:
Theorem
Complexity status?
Testing EDF-shedulability,
i.e. deiding
whether
n X
Q di
+ 1 i Q
8Q 0 :
pi
i
is weakly oNP-hard.
=1
Simultaneous Diophantine Approximation
(SDA)
Given:
I 1 ; : : : ; n 2 Q
I bound N 2 N
I error bound " > 0
Simultaneous Diophantine Approximation
(SDA)
Given:
I 1 ; : : : ; n 2 Q
I bound N 2 N
I error bound " > 0
Deide:
i
i=1;:::;n 9Q 2 f1; : : : ; N g : max Z Q
Q"
Simultaneous Diophantine Approximation
(SDA)
Given:
I 1 ; : : : ; n 2 Q
I bound N 2 N
I error bound " > 0
Deide:
i
i=1;:::;n 9Q 2 f1; : : : ; N g : max Z Q
Q"
, 9Q 2 f1; : : : ; N g : i max
jdQi Qij "
;:::;n
=1
Simultaneous Diophantine Approximation
(SDA)
Given:
I 1 ; : : : ; n 2 Q
I bound N 2 N
I error bound " > 0
Deide:
i
i=1;:::;n 9Q 2 f1; : : : ; N g : max Z Q
Q"
, 9Q 2 f1; : : : ; N g : i max
jdQi Qij "
;:::;n
=1
I NP-hard [Lagarias '85℄
Simultaneous Diophantine Approximation
(SDA)
Given:
I 1 ; : : : ; n 2 Q
I bound N 2 N
I error bound " > 0
Deide:
i
i=1;:::;n 9Q 2 f1; : : : ; N g : max Z Q
Q"
, 9Q 2 f1; : : : ; N g : i max
jdQi Qij "
;:::;n
=1
I NP-hard [Lagarias '85℄
I Gap version NP-hard [Rossner & Seifert '96,
I
Chen & Meng '07℄
2O n -apx (2-sided) via LLL-algo [Lagarias '85℄
( )
Direted Diophantine Approximation (DDA)
Theorem (Eisenbrand & R. - APPROX'09)
1 ; : : : ; n , N , " > 0 it is NP-hard to distinguish
I 9Q 2 fN=2; : : : ; N g : max jdQi e Qi j "
Given
O(1)
i=1;:::;n
I Q 2 f1; : : : ; n log log n N g :
max jdQi e Qi j 2n "
i=1;:::;n
Some tehnialities
Theorem
Given
1 ; : : : ; n , N
2N ">0
,
it is
NP-hard to distinguish
dg
I 9Q 2 fN=2; : : : ; N g :
I Q 2 f1; : : : ; n
O(1)
log log
n
n
X
max jdQie Qij "
i=1;:::;n
i
n
X
N g : i max
jdQie Qij 2 "
;:::;n
n
=1
i
Some tehnialities
Theorem
Given
1 ; : : : ; n , N
2N ">0
,
it is
NP-hard to distinguish
dg
I 9Q 2 fN=2; : : : ; N g :
I Q 2 f1; : : : ; n
I
O
(1)
log log
n
n
X
i=1
jdQi e Qij "
Ng :
n
X
Change norm k k1 ! k k
i=1
1
jdQie Qij 2n= "
2
Some tehnialities
Theorem
Given
1 ; : : : ; n , N
2N ">0
,
it is
NP-hard to distinguish
dg
I 9Q 2 fN=2; : : : ; N g :
I Q 2 f1; : : : ; n
I
I
O
(1)
log log
n
n
X
i=1
jbQi Qij "
Ng :
n
X
i=1
jbQi Qij 2n= "
Change norm k k1 ! k k
de ! b sine dxe x = ( x) b x
1
2
Some tehnialities
Theorem
Given
1 ; : : : ; n > 0, N
2N ">0
,
it is
NP-hard to
distinguish
I 9Q 2 fN=2; : : : ; N g :
I Q 2 f1; : : : ; n
O
(1)
log log
n
n
X
i=1
jbQi Qij "
Ng :
n
X
i=1
jbQi Qij 2n= "
2
I Change norm k k1 ! k k1
I de ! b sine dxe x = ( x) b x
I i > 0 sine jbQ(i + z ) Q(i + z )j invariant for z 2 Z
Some tehnialities
Theorem
Given
1 ; : : : ; n > 0; w1 ; : : : ; wn , N
2N ">0
,
it is
NP-hard
to distinguish
I 9Q 2 [N=2; N ℄ :
I Q 2 [1; n
O
(1)
log log
n
n
X
i=1
wi jbQi Qi j "
N℄ :
n
X
i=1
wi jbQi Qi j 2n=2 "
I Change norm k k1 ! k k1
I de ! b sine dxe x = ( x) b x
I i > 0 sine jbQ(i + z ) Q(i + z )j invariant for z 2 Z
I Q 2 Z ! Q 2 Q + : Admit weights wi . Add 0 := 1 with a
huge weight w .
0
Redution (1)
Given:
DDA instane ; : : : ; n > 0; w ; : : : ; wn ; N; " > 0
1
1
Redution (1)
Given: DDA instane 1 ; : : : ; n > 0; w1 ; : : : ; wn ; N; " > 0
Dene: Task set S = f0 ; : : : ; n g s.t.
P
I Yes: 9Q 2 [N=2; N ℄ : ni=1 wi (Qi bQi ) "
) S not EDF-shedulable
(9Q 0 : DBF(S ; Q) > Q)
Pn
I No: Q 2 [N=2; 3N ℄ : i=1 wi (Qi bQi ) 3"
) S EDF-shedulable (8Q 0 : DBF(S ; Q) Q)
Redution (1)
Given: DDA instane 1 ; : : : ; n > 0; w1 ; : : : ; wn ; N; " > 0
Dene: Task set S = f0 ; : : : ; n g s.t.
P
I Yes: 9Q 2 [N=2; N ℄ : ni=1 wi (Qi bQi ) "
) S not EDF-shedulable
(9Q 0 : DBF(S ; Q) > Q)
Pn
I No: Q 2 [N=2; 3N ℄ : i=1 wi (Qi bQi ) 3"
) S EDF-shedulable (8Q 0 : DBF(S ; Q) Q)
Task system:
= (i ; di ; pi) := wi; 1 ; 1 8i = 1; : : : ; n
i
i
= ( ; d ; p ) := (3"; N=2; 1)
n
X
i
"
:=
+
p
N
i
0
0
0
0
i=1
i
| {z }
=: U = utilization
Redution (2)
QU
n
X
i=1
Q di
pi
+ 1 i
Redution (2)
n
X
QU
=
n
X
i=1
Q
pi
i=1
Q
pi
Q di
pi
i
+ 1 i
Redution (2)
n
X
QU
=
=
n
X
i=1
n
X
i=1
Q
pi
i=1
wi (Qi
Q
pi
Q di
pi
i
bQi)
+ 1 i
Redution (2)
n
X
QU
=
=
n
X
i=1
n
X
i=1
Q
pi
i=1
wi (Qi
Q
pi
Q di
pi
+ 1 i
i
bQi)
Hene
DBF(f ; : : : ; ng; Q) U , approx. error small
Q
1
Redution (3)
U
DBF(f ; : : : ; ng; Q)
1
N=2
Q
Q
N
Redution (3)
= U + N"
U
DBF(f ; : : : ; ng; Q)
1
N=2
Q
Q
N
Redution (3)
= U + N"
U
6 N"
DBF( ; Q)
Q
N=2
N
0
Q
Redution (3)
= U + N"
U
DBF(S ; Q)
Q
N=2
Q
N
Redution (3)
= U + N"
U
DBF(S ; Q)
Q
N=2
DBF(f0 ; : : : ; ng; Q) > Q
Q
N
, Q = (N ) and apx error = O(")
Open problems
Open problems
Known:
I
rst deadline miss 1 1 U i max
pi
;:::;n
=1
Open problems
Known:
I
I
rst deadline miss 1 1 U i max
pi
;:::;n
pseudopolynomial time algorithm if U 1 Æ
=1
Open problems
Known:
I
I
rst deadline miss 1 1 U i max
pi
;:::;n
pseudopolynomial time algorithm if U 1 Æ
Open Problem 1
=1
Is there a pseudopolynomial time algorithm for testing
EDF-shedulability (even if U 1)
Open problems
Known:
I
I
rst deadline miss 1 1 U i max
pi
;:::;n
pseudopolynomial time algorithm if U 1 Æ
=1
Open Problem 1
Is there a pseudopolynomial time algorithm for testing
EDF-shedulability (even if U 1)
Open Problem 2
Is there for every Æ > 0 a polynomial time algorithm for testing
EDF-shedulability if U 1 Æ.
Open problems
Known:
I
I
rst deadline miss 1 1 U i max
pi
;:::;n
pseudopolynomial time algorithm if U 1 Æ
=1
Open Problem 1
Is there a pseudopolynomial time algorithm for testing
EDF-shedulability (even if U 1)
Open Problem 2
Is there for every Æ > 0 a polynomial time algorithm for testing
EDF-shedulability if U 1 Æ.
Thanks for your attention
Download