Presentation is loading. Please wait.

Presentation is loading. Please wait.

Klara Nahrstedt Spring 2011

Similar presentations


Presentation on theme: "Klara Nahrstedt Spring 2011"— Presentation transcript:

1 Klara Nahrstedt Spring 2011
CS 414 – Multimedia Systems Design Lecture 32 – Process Management (Part 2) Klara Nahrstedt Spring 2011 CS Spring 2011

2 Administrative MLC application ‘mi-clicker’ is published on the Android Market under “MLC Edu App”. Check the class website for a document “Getting Started” with the mi-clicker!!! Starting Monday, we will use the phones at the beginning of each class, so bring phones to the class. CS Spring 2011

3 Outline EDF vs RMS Dynamic Soft Real Time Scheduling
CPU service classes Probing concept Overrun- adaptation concept CS Spring 2011

4 Admission Control (for preemptive tasks)
Schedulability test for RMS Schedulability test for EDF CS Spring 2011

5 Example Consider the following preemptive RT tasks and their characteristics T1: p1 = 50ms, e1=10ms T2: p2 = 100ms, e2=20ms T3: p3 = 200ms, e3=50ms T4: p4 = 100ms, e4=20ms Are these tasks schedulable via RMS? If yes, what is the feasible schedule? Are these tasks schedulable via EDF? CS Spring 2011

6 DSRT (Dynamic Soft Real-Time Scheduling) – Example of a Multimedia CPU Scheduler
Multiple CPU Service Classes Schedule real-time and not real-time tasks in an integrated fashion Execution Flow of a SRT Process Possible Mapping CPU Service Classes into a Multiprocessor Partitioning Design Source: Hao-hua Chu 1999 CS Spring 2011

7 CPU Service Classes Service Classes Specification Parameters
Guaranteed PCPT (Periodic Constant Processing Time) P = Period PPT = Peak Processing Time PPT PVPT (Periodic Variable Processing Time) P = Period SPT = Sustainable Processing Time PPT = Peak Processing Time BT = Burst Tolerance SPT ACPU (Aperiodic Constant Processor Utilization) PPU PPU = Peak Processor Utilization Relative Deadline PPT = Peak Processing Time Event PPT CS Spring 2011

8 Periodic Constant Processing Time Class
Example Usage Pattern: Peak Processing Time=10ms Period = 100ms 10 110 210 100 200 Time(ms) Processing IIIIIIIIIII frames CS Spring 2011

9 Periodic Variable Processing Time Class
Example Usage Pattern: Period = 100ms Peak Processing Time = 30ms Sustainable Processing Time = 15ms Burst Tolerance = 7ms 15 120 210 100 200 Time(ms) Processing of IPBBPI frames CS Spring 2011

10 Execution Flow of a SRT Process
Probing Phase Execution Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Adjusted Contract CS Spring 2011

11 C++ APIs CpuApi 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 cpu.reserve(reservation); cpu.setAdaptStrategy(strategy); // Execution Phase cpu.start(); for (;;) { doJob(); cpu.yield(); } cpu.stop(); cpu.free(); CS Spring 2011

12 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 Spring 2011

13 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. Estimate a Reservation Processor Usage Iteration Number CS Spring 2011

14 Smart Probing (3) It is Periodic Variable Processing Time (PVPT)
Compute average processor usage = 50ms Compute peak processor usage = 62ms. Max Burst = 12ms It is Periodic Variable Processing Time (PVPT) 40ms 50ms 62ms 43ms 55ms 12ms 40ms 50ms 62ms 55ms 60ms 10ms 5ms 50ms 50ms 50ms 50ms 50ms

15 Multiprocessor Partitioning Design
Guaranteed Part Non-guaranteed Part PCPT Processes Reserved Run Overrun PVPT Processes Reserved Run Burst Overrun TS Processes RT Scheduler Overrun Scheduler TS Scheduler Processor #1 RT Partition Overrun Partition TS Partition Processor #2 RT Partition Overrun Partition TS Partition CS Spring 2011

16 Admission Control Test
Given a reservation request, determine Resource Availability. (1) + (2) Processor Binding. (2) Preemptive Earliest Deadline First: CS Spring 2011

17 Partition Scheduling Processor #1 RT Partition Overrun Partition
Top-Level Scheduler Proportional Sharing RT Scheduler Overrun Scheduler TS Scheduler Multi-Level Round Robin Priority Queues Preemptive EDF Kernel Scheduler Processor #1 RT Partition Overrun Partition TS Partition Processor #2 RT Partition Overrun Partition TS Partition CS Spring 2011

18 RT Partition Scheduler
Processor #1 Waiting Queue: (Sorted with the earliest released time) p (2a) finished one iteration (3) released for next iteration p (1) admitted p Runnable Queue: (Sorted with the earliest deadline) (2b) overrunning Overrun Partition Queues CS Spring 2011

19 Overrun Partition Scheduler
Highest Priority Burst Queue (FIFO) (2) Miss Deadline p (1a) Conformed? Overrun Queue (FIFO) (1b) Nonconformed? p Permanent Non-conforming Queue (FIFO) (1c) Nonconformed frequently? Lowest Priority CS Spring 2011

20 Adaptation Adjust Reservation. Adaptive Strategy Exponential Average
Scene #1 Scene #2 Adjust Reservation. Adaptive Strategy Exponential Average CS Spring 2011 Frame 275

21 Exponential Average Adaptation Strategy
... Xws-1 Xws Xws+1 ... X2ws ... X3ws Iteration Number Adaptation Points Specification: Window Size (ws). Alpha () Xi= Guaranteed Parameter in a reservation. Xi-1 = Actual Usage. CS Spring 2011

22 User-level Priority Dispatch
Highest Priority (5) Dispatched Process runs for T ms. (4) Scheduler sleeps. Fixed RT Priority (3) Scheduler sets Timer for T ms. N DSRT Scheduler Process (6) Timer interrupts Scheduler N-1 Dispatched Process . (2) Set Processor Affinity. . Time Sharing Processes (5) Decrease Priority . (1) Increase Priority. Dynamic TS Priority RT Process Pool Lowest Priority CS Spring 2011

23 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 Spring 2011

24 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 Spring 2011

25 Experimental Result SRT2: MPEG player with P=50ms.
CS Spring 2011

26 Experimental Result (Cont.)
SRT3: Sampling program with P=50ms. SRT4: Java game with P=100ms. CS Spring 2011

27 Conclusion (Over-provisioning 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 Current Thesis: With over-provisioning we get Quality of Service !! CS Spring 2011

28 Conclusion (Problems with Over-provisioning)
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 Campus Need support of QoS in OS towards multimedia tasks CS Spring 2011


Download ppt "Klara Nahrstedt Spring 2011"

Similar presentations


Ads by Google