cs 414 – multimedia systems design lecture 32 – process management (part 2)
DESCRIPTION
CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2). Klara Nahrstedt Spring 2009. Outline. MP4 is out , Start early Competition on May 1, 2009, 5-6:30pm in 216 SC Deadline April 30 (pre-competition to decide on the finalists) - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/1.jpg)
CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)
Klara Nahrstedt
Spring 2009
CS 414 - Spring 2009
![Page 2: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/2.jpg)
Outline MP4 is out, Start early Competition on May 1, 2009, 5-6:30pm in 216 SC Deadline April 30 (pre-competition to decide on the
finalists) Exact rules, scenarios of the competition will be posted next
Monday, April 20.
All should come, pizza and 1,2,3rd prices of the competition will be provided between 6:30-7pm on May 1 in 0216 SC
CS 414 - Spring 2009
![Page 3: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/3.jpg)
Overprovisioning Approach Current Approach:
To achieve throughput - overprovision of resources (fast processors, large disks, fast I/O bus, high-speed networks), and exclusive usage of resources
To achieve timing - overprovision CPU, exclusive usage of resources, application-dependent scheduling
With over-provisioning we get Quality of Service !!
CS 414 - Spring 2009
![Page 4: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/4.jpg)
Problems with OverprovisioningVery High Cost (due to unused resources)
Exclusive Networks and Special Purpose Machines
Violation of Timing Guarantees in Exclusive Case (head-of-line blocking)
Sensory and Video Data Processing/Transmission
Violation of Timing/Throughput Guarantees in Shared Case (greedy applications, flows)
UDP flows versus TCP Flows
Last Mile Problem (not everywhere is over-provisioning possible)
Telescopes, University CampusCS 414 - Spring 2009
![Page 5: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/5.jpg)
DSRT Concepts
CPU Service Classes Mapping CPU Service Classes into a
Multiprocessor Partitioning Design Execution Flow of a SRT Process
CS 414 - Spring 2009
![Page 6: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/6.jpg)
CPU Service ClassesService Classes Specification Parameters Guaranteed
PCPT(Periodic Constant Processing Time)
P = PeriodPPT = Peak Processing Time
PPT
PVPT (Periodic Variable Processing Time)
P = PeriodSPT = Sustainable Processing TimePPT = Peak Processing TimeBT = Burst Tolerance
SPT
ACPU(Aperiodic Constant Processor Utilization)
PPU = Peak Processor Utilization
PPU
Event Relative DeadlinePPT = Peak Processing Time
PPTCS 414 - Spring 2009
![Page 7: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/7.jpg)
Periodic Constant Processing Time Class Example Usage Pattern:
Peak Processing Time=10msPeriod = 100ms
0 10010 110
Time(ms)
200 210
CS 414 - Spring 2009
![Page 8: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/8.jpg)
Periodic Variable Processing Time Class Example Usage Pattern:
Period = 100msPeak Processing Time = 30msSustainable Processing Time = 15msBurst Tolerance = 7ms
0 10015 120
Time(ms)
200210
CS 414 - Spring 2009
![Page 9: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/9.jpg)
Execution Flow of a SRT Process
ProbeAdmissionControl
Monitor/Conformance Test
Probing PhaseReservation Phase
Execution Phase
Adaptation
ExtractReservation Contract
Processor Binding
Adjusted Contract
SRT Process
Scheduling
CS 414 - Spring 2009
![Page 10: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/10.jpg)
Smart Offline Probing (1)
Goal: Extract a reservation.Determine the most suitable Service Class
and Parameters.Avoid over/under reserve resources.
Needed because:Processor usage is hardware platform
dependent.Processor usage is input dependent.
CS 414 - Spring 2009
![Page 11: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/11.jpg)
Smart Probing (2)
DSRT runs a few iterations of SRT applications without reservation.
DSRT monitors the usage iteration by iteration. DSRT analyzes the usage history.
0
50
100
1 3 5 7 .Pro
cess
or
Usa
ge
Iteration NumberConformance Test ?
Estimate a Reservation
CS 414 - Spring 2009
![Page 12: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/12.jpg)
Conformance Test (1)
4050
62
43
55
0
10
20
30
40
50
60
70
1 2 3 4 5 6
Processor Usage
Reserved Usage
Nonconformance
Conformance
Burst Tolerance
CS 414 - Spring 2009
![Page 13: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/13.jpg)
Conformance Test (2)
PCPT Class
Processor Usage
PPT Leak every P
PPT(1+SSBTR)
PVPT Class
Processor Usage
SPT Leak every P
SPT(1+SSBTR)+BT
PPT Leak every P
PPT(1+SSBTR)
SSBTR = System Specific Burst Tolerance Rate.
CS 414 - Spring 2009
![Page 14: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/14.jpg)
Smart Probing (3) Compute average processor
usage = 50ms Compute peak processor usage
= 62ms. Max Burst = 12ms
4050
62
43
55
0
10
20
30
40
50
60
70
1 2 3 4 5 6
50ms 50ms
12ms
50ms 50ms
40ms
40ms
50ms
50ms
62ms
62ms
55ms
43ms
60ms
55ms
10ms
50ms
5ms
CS 414 - Spring 2009
![Page 15: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/15.jpg)
Smart Probing (4)
SSBTR = 10% Average Processor Usage * SSBTR = 5ms If Max Burst < 5ms
Constant Processing Time Class
else if Max Burst (12ms) > 5ms, Variable Processing Time Class
Sustainable Processing Time =50ms Peak Processing Time = 62ms Burst Tolerance = 12ms - 5ms = 7ms
CS 414 - Spring 2009
![Page 16: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/16.jpg)
Admission Control Test Given a reservation request, determine
Resource Availability. (1) + (2) Processor Binding. (2)
Preemptive Earliest Deadline First:
( )1 Ri RtPartitionall p all pri
( ) ,..2 1For pr R RtPartitionj N i jp bound to pri j
R
PPT P
SPT P
PPU
if p PCPT Event
if p PVPT
if p ACPUi
i
i
i
/ ,
/ ,
,
,
CS 414 - Spring 2009
![Page 17: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/17.jpg)
Multiprocessor Partitioning Design
Guaranteed PartNon-guaranteed Part
PCPT Processes
PVPT Processes
RT SchedulerOverrun Scheduler TS Scheduler
TS Processes
Reserved RunOverrun
Burst
Reserved Run Overrun
Processor #1
Processor #2
RT Partition Overrun Partition
TS Partition
RT Partition Overrun Partition
TS Partition
CS 414 - Spring 2009
![Page 18: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/18.jpg)
Partition Scheduling
RT Scheduler Overrun Scheduler TS Scheduler
Processor #1
Processor #2
RT Partition Overrun Partition
TS Partition
RT Partition Overrun Partition
TS Partition
Top-Level Scheduler
PreemptiveEDF
Multi-Level Round Robin Priority Queues
KernelScheduler
Proportional Sharing
CS 414 - Spring 2009
![Page 19: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/19.jpg)
RT Partition Scheduler
Waiting Queue: (Sorted with the earliest released time)
Processor #1
p
p
p
Runnable Queue: (Sorted with the earliest deadline)
(1) admitted
(2a) finished one iteration
(2b) overrunning
(3) released for next iteration
Overrun Partition QueuesCS 414 - Spring 2009
![Page 20: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/20.jpg)
Overrun Partition Scheduler
Burst Queue (FIFO)
Overrun Queue (FIFO)
Permanent Non-conforming Queue (FIFO)
p
(1a) Conformed?
(1b) Nonconformed?
(1c) Nonconformed frequently?
p
(2) Miss Deadline
Lowest Priority
Highest Priority
CS 414 - Spring 2009
![Page 21: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/21.jpg)
AdaptationScene #2Scene #1
Frame 275
Adjust Reservation.
3 StrategiesExponential
AverageRangeStatistical
CS 414 - Spring 2009
![Page 22: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/22.jpg)
Exponential Average Adaptation Strategy
X1 XwsX2 X2ws X3wsXws-1...X3 Xws+1 ......
Adaptation Points
Specification: Window Size (ws). Alpha () Xi= Guaranteed Parameter in a reservation.
Xi-1 = Actual Usage.
Iteration Number
X X Xi i i ( )1 1 CS 414 - Spring 2009
![Page 23: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/23.jpg)
Statistical Adaptation Strategy
X1 XwsX2 X2ws X3wsXws-1...X3 Xws+1 ......
Adaptation Points
Specification: Window Size (ws). Overrun Tolerance Frequency (f).
Example: ws=10, f=20%. Adjust X=40ms.
Iteration
IterationNumber
1 2 3 4 5 6 7 8 9 10
ProcessorTime(ms)
40 42 38 39 40 41 39 35 40 38
CS 414 - Spring 2009
![Page 24: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/24.jpg)
User-level Priority Dispatch
DSRT Scheduler Process
Dispatched Process
(3) Scheduler sets Timer for T ms.
(1) Increase Priority.
(2) Set Processor Affinity.(5) Decrease
Priority
Highest Priority
Lowest Priority
Time Sharing Processes
RT Process Pool
.......
.......
.......
.......
Fixed RT Priority
Dynamic TS Priority
(4) Schedulersleeps.
(5) Dispatched Process runsfor T ms.
(6) TimerinterruptsScheduler
N
N-1
0
.
.
.
CS 414 - Spring 2009
![Page 25: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/25.jpg)
C++ APIsCpuApi cpu;
CpuReservation reservation;
// Probing Phase;
cpu.probe();
cpu.start();
for (int i=0; i<numProbeIterations; i++) {
doJob();
cpu.yield();
}
cpu.stop();
cpu.probeEnd();
cpu.probeMatch(&reservation);
// Reservation Phase// Reservation Phase
cpu.reserve(reservation);cpu.reserve(reservation);
cpu.setAdaptStrategy(strategy);cpu.setAdaptStrategy(strategy);
// Execution Phase// Execution Phase
cpu.start();cpu.start();
for (;;) {for (;;) {
doJob();doJob();
cpu.yield();cpu.yield();
}}
cpu.stop();cpu.stop();
cpu.free();cpu.free();
CS 414 - Spring 2009
![Page 26: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/26.jpg)
Experiment
Dual Processor Sun Ultra 2 Machine. Solaris 2.6 Operating System. Dispatch Latency 400us. Includes
Scheduling Algorithm.Context Switches.Various system calls.
CS 414 - Spring 2009
![Page 27: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/27.jpg)
Experiment Setup
Run 8 TS processes and 5 SRT processes concurrently.
TS1-6: Computational intensive programs. TS7-8: Compilation programs. SRT1: A MPEG player at 10 FPS.
Probing (PVPT class, P=100ms, SPT=28ms, PPT=40ms, BT=11ms). Adaptation Strategy: (Statistical, f = 20%, ws = 20).
CS 414 - Spring 2009
![Page 28: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/28.jpg)
Experimental Setup (Cont.) SRT2: A MPEG player at 20 FPS.
Probing (PVPT class, P=50ms, SPT=14ms, PPT=21ms, BT=6ms)
SRT3: A sampling program. Probing(PCPT class, P=50ms, PPT=10ms)
SRT4: A Java RocksInSpace game. (PCPT class, P=100ms, PPT=30ms).
SRT5: Misbehaving greedy program. (PCPT class, P=500ms, PPT=10ms).
CS 414 - Spring 2009
![Page 29: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/29.jpg)
Experimental Result
SRT1: MPEG player With P=100ms
SRT2: MPEG player with P=50ms.
CS 414 - Spring 2009
![Page 30: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/30.jpg)
Experimental Result (Cont.)
SRT3: Sampling program with P=50ms.
SRT4: Java game with P=100ms.
CS 414 - Spring 2009
![Page 31: CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2)](https://reader035.vdocuments.site/reader035/viewer/2022062718/56812f21550346895d94ba42/html5/thumbnails/31.jpg)
Conclusion
Careful planning of CPU resources works for multimedia applications and other applications that share the CPU
CS 414 - Spring 2009