Transcript ppt
Compositional Real-Time
Scheduling Framework
Insik Shin
October 3, 2005
CIS 700
1
Outline
• Compositional scheduling framework
– Scheduling component model
– Periodic resource model
• Schedulability analysis
• Utilization bound
• Component timing abstraction
October 3, 2005
CIS 700
2
Traditional Scheduling Framework
• Single real-time task in a single application
Application
Application
Application
Task
Task
Task
OS Scheduler
CPU
October 3, 2005
CIS 700
3
Hierarchical Scheduling Framework (HFS)
• Multiple real-time tasks with a scheduler in a single
application, forming a hierarchy of scheduling
Task
Task
Application
Scheduler
Task
Task
Application
Scheduler
Task
Task
Application
Scheduler
OS Scheduler
CPU
October 3, 2005
CIS 700
4
Compositional Scheduling Framework
Digital
Controller
Multimedia
Java Virtual Machine
T2(33,10)
J1(50,3)
T1(25,5)
J2(75,5)
VM Scheduler
OS Scheduler
CPU
October 3, 2005
CIS 700
5
VM Scheduler’s Viewpoint
Digital
Multimedia
Controller
T2(33,10)
Real-Time
T1(25,5)Guarantee
on CPU Supply
Java Virtual Machine
J1(50,3)
J2(75,5)
VM Scheduler
CPU Share
OS Scheduler
CPU
October 3, 2005
CIS 700
6
Problems & Approach I
• Resource supply modeling
–
Characterize temporal property of resource allocations
• we propose a periodic resource model
–
Analyze schedulability with a new resource model
October 3, 2005
CIS 700
7
OS Scheduler’s Viewpoint
Digital
Controller
Multimedia
Java Virtual Machine
T2(33,10)
T1(25,5)
J1Real-Time
(50,3)
JTask
2(75,5)
Real-Time
VM
Scheduler
Demand
OS Scheduler
CPU
October 3, 2005
CIS 700
8
Problems & Approach II
• Real-time demand composition
–
Combine multiple real-time requirements into a single
real-time requirement
Real-Time
Constraint
Real-Time
Constraint
Real-Time
Constraint
T1 (p1, e1)
T2 (p2, e2)
T (p, e)
EDF / RM
October 3, 2005
CIS 700
9
Compositional Real-time Scheduling Framework
•
Goal
–
to support compositionality
for timeliness aspect
– to achieve system-level
schedulability analysis using
the results of component-level
schedulability analysis
•
Scheduling component modeling
October 3, 2005
CIS 700
10
Scheduling Component Modeling
• Scheduling
– assigns resources to workloads by scheduling algorithms
• Scheduling Component Model : C(W,R,A)
– W : workload model
– R : resource model
– A : scheduling algorithm
Periodic
Workload
Task
Periodic
Workload
Task
EDF
Scheduler
/ RM
Resource
???
October 3, 2005
CIS 700
11
Resource Modeling
• Dedicated resource : always available at full capacity
0
time
• Shared resource : not a dedicated resource
– Time-sharing : available at some times
0
time
– Non-time-sharing : available at fractional capacity
0
October 3, 2005
time
CIS 700
12
Resource Modeling
• Time-sharing resources
– Bounded-delay resource model [Mok et al., ’01]
characterizes a time-sharing resource w.r.t. a non-timesharing resource
– Periodic resource model Γ(Π,Θ) [Shin & Lee, RTSS ’03]
characterizes periodic resource allocations
0
October 3, 2005
1
2
3
4
5
CIS 700
6
7
8
9 time
13
Schedulability Analysis
• A workload set is schedulable under a scheduling algorithm
with available resources if its real-time requirements are
satisfiable
• Schedulability analysis determines whether
resource demand,
which a workload set
requires under
a scheduling algorithm
workload
≤
workload
resource supply,
which available
resources provide
resource
scheduler
October 3, 2005
CIS 700
14
Resource Demand Bound
• Resource demand bound during an interval of length t
– dbf(W,A,t) computes the maximum possible
resource demand that W requires under algorithm
A during a time interval of length t
demand
• Periodic task model T(p,e) [Liu & Layland, ’73]
– i.e., T(3,2)
t
0
1
October 3, 2005
2
3
4
5
CIS 700
6
7
8
9
10
15
Demand Bound Function - EDF
• For a periodic workload set W = {Ti(pi,ei)},
– dbf (W,A,t) for EDF algorithm [Baruah et al.,‘90]
t
dbf (W, EDF, t) ei
TiW pi
demand
– Example: W = {T1(3,2), T2(4,1)}
t
0
1
October 3, 2005
2
3
4
5
CIS 700
6
7
8
9
10
16
Resource Supply Bound
• Resource supply during an interval of length t
– sbfR(t) : the minimum possible resource supply by
resource R over all intervals of length t
• For a single periodic resource model, i.e., Γ(3,2)
– we can identify the worst-case resource allocation
October 3, 2005
CIS 700
17
Resource Supply Bound
• supply = 3
i
R(3,2)
0
time
• supply = 1
R(3,2)
0
• sbfR(i) =
October 3, 2005
time
1
CIS 700
18
Resource Supply Bound
• Resource supply during an interval of length t
– sbfR(t) : the minimum possible resource supply by
resource R over all intervals of length t
supply
• For a single periodic resource model, i.e., Γ(3,2)
– we can identify the worst-case resource allocation
t
0
October 3, 2005
1
2
3
4
CIS 700
5
6
7
8
9
10
19
Supply Bound Function
• Resource supply during an interval of length t
– sbfΓ(t) : the minimum possible resource supply by
resource R over all intervals of length t
• For a single periodic resource model Γ(Π,Θ)
supply
t (k 1)( ) if t (k 1) 2, (k 1)
sbf( t )
(k 1)
otherwise
October 3,0 2005
t
1
2
3
4
5
CIS 700
6
7
8
9
10
20
Schedulability Conditions (EDF)
• A workload set W is schedulable over a resource
model R under EDF if and only if for all interval i of
length t
dbfw(i) ≤ t
[BHR90]
Resource demand
in an interval
Resource supply
the interval
dbfw(i) ≤ sbfRduring
(i)
(from a dedicated resource)
– sbfR(i) : the minimum resource supply by resource R
during an interval i
– dbfw(i) : the resource demand of workload W during an
interval i
October 3, 2005
CIS 700
21
Schedulability Condition - EDF
• A periodic workload set W is schedulable under
EDF over a periodic resource model Γ(Π,Θ)
if and only if
t 0
dbf(W, EDF, t) sbf( t )
20
18
16
14
12
10
8
6
4
supply
2
demand
0
1
October 3, 2005
4
7
10
13
16
19
22
CIS 700
25
28
time
22
Schedulability Condition - RM
• A periodic workload set W is schedulable under
EDF over a periodic resource model Γ(Π,Θ)
if and only if
t 0 Ti W
dbf(W, RM, t, i) sbf( t )
• For a periodic workload set W = {Ti(pi,ei)},
– dbf (W,A,t,i) for RM algorithm [Lehoczky et al., ‘89]
t
dbf (W, RM, t, i) ei ek
TkHP (Ti ) pk
October 3, 2005
CIS 700
23
Utilization Bounds
• For a periodic workload T(p,e), utilization UT = e/p
• For a periodic workload set W, utilization UW is
ei
p
TiW
i
• Utilization bound (UB) of a resource model R
– given a scheduling algorithm A and a resource
model R, UBR,A is a number s. t. a workload set W
is schedulable if
workload
UW UBR , A
workload
scheduler
resource
October 3, 2005
CIS 700
24
Utilization Bounds
• Example:
– Consider a periodic resource Γ(Π,Θ), where Π =
10 and Θ = 4, and suppose UB Γ,EDF = 0.4.
– Then, a set of periodic task W is schedulable if
UW 0.4
– W = {T1(20,3), T2(50,5)} s.t.
UW = 0.25, is schedulable
workload
workload
EDF
Γ(Π=10,Θ=4)
October 3, 2005
CIS 700
25
Utilization Bound - EDF
• For a scheduling component C(W, Γ(Π,Θ),A), where
A = EDF, its utilization bound is
k U
UB , EDF(Pmin )
k 2(1 U)
• Pmin is the minimum task period (deadline) in W.
• k represents the relationship between resource period Π
and the minimum task period Pmin, k ≈ Pmin /Π
October 3, 2005
CIS 700
26
EDF Utilization Bound - Intuition
• Observation for a component C(W, Γ(Π,Θ),EDF)
– C is schedulable iff dbf (W,EDF,t) ≤ sbfΓ (t)
sbfΓ (t)
dbf (W,EDF,t)
October 3, 2005
Pmin
CIS 700
t
27
EDF Utilization Bound - Intuition
• Observation for a component C(W, Γ(Π,Θ),EDF)
– C is schedulable iff dbf (W,EDF,t) ≤ sbfΓ (t)
– dbf (W,EDF,t) ≤ UW· t
sbfΓ (t)
dbf (W,EDF,t)
October 3, 2005
Pmin
CIS 700
UW· t
t
28
EDF Utilization Bound - Intuition
• Observation for a component C(W, Γ(Π,Θ),EDF)
– C is schedulable iff dbf (W,EDF,t) ≤ sbfΓ (t)
– dbf (W,EDF,t) ≤ UW· t
– UΓ(t-2(Π-Θ)) ≤ sbfΓ (t)
UΓ(t-2(Π-Θ))
sbfΓ (t)
dbf (W,EDF,t)
October 3, 2005
Pmin
CIS 700
UW· t
t
29
EDF Utilization Bound - Intuition
• Observation for a component C(W, Γ(Π,Θ),EDF)
– C is schedulable iff dbf (W,EDF,t) ≤ sbfΓ (t)
– dbf (W,EDF,t) ≤ UW· t
– UΓ(t-2(Π-Θ)) ≤ sbfΓ (t)
– Therefore, C is schedulable if UW· t ≤ UΓ(t-2(Π-Θ))
UΓ(t-2(Π-Θ))
UW· t
t
October 3, 2005
Pmin
CIS 700
30
EDF Utilization Bound - Intuition
• For a component C(W, Γ(Π,Θ),EDF)
– for all t > Pmin, if UW· t ≤ UΓ(t-2(Π-Θ))
then C is schedulable.
UW ≤ UΓ(t-2(Π-Θ)) / t
UΓ(t-2(Π-Θ))
UW· t
t
October 3, 2005
Pmin
CIS 700
31
Utilization Bound - RM
• For a scheduling component C(W, Γ(Π,Θ),A), where
A = RM, its utilization bound is
– [Saewong, Rajkumar, Lehoczky, Klein, ’02]
1
n
3
U
UB, RM (n) n
1
3 2 U
– We generalize this earlier result, where k ≈ Pmin/ Π.
1
n
2k 2(1 U)
1
UB , RM (n, Pmin ) U n
k 2(1 U)
October 3, 2005
CIS 700
32
Component Abstraction
• Component timing abstraction
– To specify the collective real-time demands of a
component as a timing interface
Periodic
(50,7)
Periodic
(70,9)
virtual
timing
real-time
interface
task
EDF
October 3, 2005
CIS 700
33
Component Abstraction
• Component timing abstraction
– To specify the collective real-time demands of a
component as a timing interface
Periodic
(50,7)
periodic
timing
interface
interface
Γ(Π,Θ)
Periodic
(70,9)
EDF
periodic
resource
Γ(Π,Θ)
October 3, 2005
CIS 700
34
Component Abstraction (Example)
• In this example, a solution space of a periodic
resource Γ(Π,Θ) that makes C(W, Γ(Π,Θ),EDF)
schedulable is
Periodic
(50,7)
Periodic
(70,9)
EDF
Γ(Π,Θ)
Γ(Π,Θ)
resource capacity
(a) Solution Space under EDF
1
0.8
0.6
0.4
0.2
0
1
October 3, 2005
CIS 700
10
19
28
37
46
resource period
55
64
73
35
Component Abstraction (Example)
• An approach to pick one solution out of the solution space
– Given a range of Π, we can pick Γ(Π,Θ) such that UΓ is
minimized. (for example, 28 ≤ Π ≤ 46)
Periodic
(50,7)
Periodic
(70,9)
EDF
Γ(29,9.86)
Γ(Π,Θ)
resource capacity
(a) Solution Space under EDF
1
0.8
0.6
0.4
0.2
0
1
October 3, 2005
CIS 700
10
19
28
37
46
resource period
55
64
73
36
Component Timing Abstraction
• Component timing abstraction
– To abstract the collective real-time demands
of a component as a timing interface
Periodic
(50,7)
Periodic
(70,9)
periodic
interface
Γ(29, 9.86)
EDF
October 3, 2005
CIS 700
37
Compositional Real-Time Guarantees
R(?, ?)
EDF
RR
?)
1(10,
1(?, 3.1)
EDF
RR
?)
2(10,
2(?, 4.4)
T11(25,4)
RM
T12(40,5)
October 3, 2005
T21(25,4)
T22(40,5)
CIS 700
38
Compositional Real-Time Guarantees
R(5,
R(?,4.4)
?)
EDF
T1(10, 3.1)
T2(10, 4.4)
R1(10, 3.1)
R2(10, 4.4)
EDF
T11(25,4)
RM
T12(40,5)
October 3, 2005
T21(25,4)
T22(40,5)
CIS 700
39
Abstraction Overhead
• For a scheduling component C(W, Γ(Π,Θ), A), its
abstraction overhead (OΓ) is U
UW
Periodic
(50,7)
Periodic
(70,9)
periodic
interface
Γ(29, 9.86)
EDF
UW=0.27
October 3, 2005
-1
UΓ=0.34
CIS 700
40
Abstraction Overhead Bound
• For a scheduling component C(W, Γ(Π,Θ), A), its
abstraction overhead (OΓ) is
– A = EDF
– A = RM
October 3, 2005
O , EDF
O , RM
2 (1 UW )
k 2 UW
1
1
2k 21 UW
log
k 21 UW
CIS 700
41
Abstraction Overhead
• Simulation Results
– with periodic workloads and periodic resource under
EDF/RM
– the number of tasks n : 2, 4, 8, 16, 32, 64
– the workload utilization U(W) : 0.2~0.7
– the resource period : represented by k
October 3, 2005
CIS 700
42
Abstraction Overhead
• k= 2, U(W) = 0.4
Analytical Bound - EDF
Simulation Result - EDF
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
2
4
8
16
32
64
The Number of Tasks
October 3, 2005
CIS 700
43
Summary
•
Compositional real-time scheduling framework
- with the periodic model [Shin & Lee, RTSS ‘03]
1. resource modeling
– utilization bounds (EDF/RM)
2. schedulability analysis
• exact schedulability conditions (EDF/RM)
3. component timing abstraction and composition
• overhead evaluation
– upper-bounds and simulation results
October 3, 2005
CIS 700
44
Future Work
• Extending our framework for handling
– Soft real-time workload models
– non-periodic workload models
– task dependency
October 3, 2005
CIS 700
45
References
• Insik Shin & Insup Lee,
“Periodic Resource Model for Compositional Real-Time
Gaurantees”, the Best Paper of RTSS 2003.
• Insik Shin & Insup Lee,
“Compositional Real-time Scheduling Framework”,
RTSS 2004.
October 3, 2005
CIS 700
46
THANK YOU
THE END
October 3, 2005
THE
END
THE
END
CIS 700
47