Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Workload-oriented Programming
Silviu S. Craciunas
Department of Computer SciencesUniversity of Salzburg, Austria
-joint work with
C. Kirsch, H. Röck, and A. Sokolova
July 2008
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 1 / 26
Tiptoe RTOS
TiptoePrototype real-time operating system.http://tiptoe.cs.uni-salzburg.at
Processes are sequences of actionsActions may have workload parameters that determine theamount of work involvedWe are interested in the temporal performance of actions withrespect to the workload involved
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 2 / 26
Example
Consider a process that:allocates memory for a video streamreads the video stream from a network connectioncompresses the streamstores it on diskdeallocates the used memory
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 3 / 26
Example
Pseudo-codeloop {
int number_of_frames=determine_rate();
allocate_memory(number_of_frames);read_from_network(number_of_frames);
compress_data(number_of_frames);
write_to_disk(number_of_frames);deallocate_memory(number_of_frames);
} until (done); <– requirements
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 4 / 26
Example
Pseudo-codeloop {
int number_of_frames=determine_rate();
allocate_memory(number_of_frames);<– requirements 1read_from_network(number_of_frames);<– requirements 2
compress_data(number_of_frames);<– requirements 3
write_to_disk(number_of_frames);<– requirements 4deallocate_memory(number_of_frames);<– requirements 5
} until (done);
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 4 / 26
Example
Pseudo-codeloop {
int number_of_frames=determine_rate();
> allocate_memory(number_of_frames);read_from_network(number_of_frames);
compress_data(number_of_frames);
write_to_disk(number_of_frames);deallocate_memory(number_of_frames);
} until (done);
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 4 / 26
Response-time function
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
Good
0 5 10 15 20 25
f R
100
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 5 / 26
Improving latency over throughput
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
Good
0 5 10 15 20 25
f R
100
8
1
allocation rate of 125 fps
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 6 / 26
Improving throughput over latency
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
Good
0 5 10 15 20 25
f R
1 0 0
2 4
allocation rate of 240 fps
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 7 / 26
Response-time function
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
Good
0 5 10 15 20 25
f R
100
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 8 / 26
Response-time function
InformallyThe response-time (RT) function fR characterizes the action’sresponse time bound for a given workload, independently of anyprevious or concurrent actions.
FormallyA response-time (RT) function is a discrete function
fR : N→ Q+
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 9 / 26
Execution-time function
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
0 5 10 15 20 25
f R
100
fE
10
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 10 / 26
Execution-time function
80
60
40
20
0
Memory al location requests in number of frames
Time (ms)
Bad
0 5 10 15 20 25
f R
100
fE
10
f is a parametric version of WCETE
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 11 / 26
Execution-time function
InformallyThe execution-time (ET) function fE characterizes the action’sexecution time bound for a given workload, in the absence of anyconcurrent actions.
FormallyAn execution-time (ET) function is a discrete function
fE : ED → Q+.
where ED ⊆ N is called the execution domain.
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 12 / 26
Scheduling and Admission
Process schedulingHow do we efficiently schedule processes on the level of individualprocess actions?
Process admissionHow do we efficiently test schedulability of newly arriving processes?
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 13 / 26
Virtual periodic resources
Virtual periodic resources
Period π Limit λ Utilizationλ
π
We use our modified version of the CBS1 which allows different π andλ for a process.
1Luca Abeni and Giorgio Buttazzo - Resource Reservation in Dynamic Real-TimeSystems, Journal of Real-Time Systems, Volume 27 (2), 2004Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 14 / 26
Virtual periodic resources
Each process declares a finite set of virtual periodic resourcesEach process action of a process uses exactly one virtual periodicresource declared by the process
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 15 / 26
Scheduled response time
The scheduled response time fS(w) is the time from the arrival of anaction until it completes.
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 16 / 26
Schedulabilty result
A set of processes is schedulable under EDF ifFor every action of every process, λ and π “sample” fR such that
∀w ∈ ED, fS(w) ≤ fR(w)
The schedulability test holds for the set of processes∑P
maxR
λPR
πPR≤ 1
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 17 / 26
Response time sampling
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 18 / 26
Tiptoe compositionality
∀fS, fS′,∀w ∈ ED
0 ≤ |fS(w)− fS′(w)| ≤ πa − 1
if the schedulability test holds
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 19 / 26
Tiptoe compositionality
Response-time jitterAny individual action a of a process maintains its response time withinπa − 1 even when adding/removing concurrent processes.
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 20 / 26
Implementation and performance
list array matrixtime O(n2) O(log(t) + n · log(t)) Θ(t)space Θ(n) Θ(t + n) Θ(t2 + n)
5 0 150 250 350 450 550 650
2 04 06 0
8 0100120
140160180
200220240260
280300 bitmap_array_max
list_maxmatrix_max
5 0 150 250 350 450 550 650
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7bitmap_array_stddevlist_stddevmatrix_stddev
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 21 / 26
Implementation and performance
list array matrixtime O(n2) O(log(t) + n · log(t)) Θ(t)space Θ(n) Θ(t + n) Θ(t2 + n)
0 3 3 6 7 100 150 200 250 300 349
5
2 0
100
500
2000
10000
50000
200000
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 21 / 26
Implementation and performance
list array matrixtime O(n2) O(log(t) + n · log(t)) Θ(t)space Θ(n) Θ(t + n) Θ(t2 + n)
0 3 3 6 5 9 8 131 180 229 278 327
5
2 0
100
500
2000
10000
50000
200000
1000000
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 21 / 26
Implementation and performance
list array matrixtime O(n2) O(log(t) + n · log(t)) Θ(t)space Θ(n) Θ(t + n) Θ(t2 + n)
0 3 3 6 5 9 8 130 179 228 276 325
5
2 0
100
500
2000
10000
50000
200000
1000000
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 21 / 26
Implementation and performance
list array matrixtime O(n2) O(log(t) + n · log(t)) Θ(t)space Θ(n) Θ(t + n) Θ(t2 + n)
20
25
210
215
220
matrix
matrix-tree
array
list2
5 28 2
11 214
5KB
100KB
5MB
100MB
1GB
memory usage
KB
time instants (t)
memory usage
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 21 / 26
Conclusion
The model enablestrading off throughput and latencysequential and concurrent process compositioncontrolling the response-time variance (jitter) of individual processactions
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 22 / 26
Conclusion
The model enablestrading off throughput and latencysequential and concurrent process compositioncontrolling the response-time variance (jitter) of individual processactions
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 22 / 26
Conclusion
The model enablestrading off throughput and latencysequential and concurrent process compositioncontrolling the response-time variance (jitter) of individual processactions
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 22 / 26
Current work
Fly the JAviator with Tiptoe
Homepagehttp://javiator.cs.uni-salzburg.at
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 23 / 26
Thank you!
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 24 / 26
Scheduled response time
∀w ∈ UD, fS(w) ≤ fR(w) + π ifλ
π= cU
π divides fR(w) evenly∑P maxR
λPRπPR≤ 1
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 25 / 26
Scheduled response time
∀w ∈ UD, fS(w) ≤ fR(w) ifλ
π= cU
0 < π ≤ dR − dEcU
π divides dR and fR(w)− dR evenly∑P maxR
λPRπPR≤ 1
Silviu Craciunas (U Salzburg, Austria) MoCC Artist Workshop 2008 Eindhoven, Netherlands 26 / 26