1 / 35

Dynamic Soft Real Time Scheduling (DSRT) System

Dynamic Soft Real Time Scheduling (DSRT) System. Klara Nahrstedt cs589kn. Problem Statement. Multimedia applications need guaranteed and continuous processor time allocation. A MPEG decoder running at 10 frames per second. A game animation updating the movements of objects every 50ms.

sailor
Télécharger la présentation

Dynamic Soft Real Time Scheduling (DSRT) System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dynamic Soft Real Time Scheduling (DSRT) System Klara Nahrstedt cs589kn

  2. Problem Statement • Multimedia applications need guaranteed and continuous processor time allocation. • A MPEG decoder running at 10 frames per second. • A game animation updating the movements of objects every 50ms. • Applications have Soft Deadlines. • Run on General Purpose OS. • Limitations: I/O Interrupts, Layered memory subsystem, priority inversion, ...

  3. DSRT Solution • Basic Features are insufficient. • Unique/Advanced Features • CPU Service Classes. • Probing Service. • Adaptive Service. • Advanced Reservations*. • Security/Access Model*. • Multiprocessor Support. • Distributed Monitoring Support*. • Middleware Implementation.

  4. DSRT Concepts • CPU Service Classes • Mapping CPU Service Classes into a Multiprocessor Partitioning Design • Execution Flow of a SRT Process

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

  6. Periodic Constant Processing Time Class • Example Usage Pattern: Peak Processing Time=10ms Period = 100ms 0 10 110 210 100 200 Time(ms)

  7. 0 15 120 210 100 200 Periodic Variable Processing Time Class • Example Usage Pattern: Period = 100ms Peak Processing Time = 30ms Sustainable Processing Time = 15ms Burst Tolerance = 7ms Time(ms)

  8. Multiprocessor Partitioning Design Guaranteed Part Non-guaranteed Part PCPT Processes Reserved Run Overrun Reserved Run Burst Overrun PVPT Processes TS Processes RT Scheduler Overrun Scheduler TS Scheduler Processor #1 RT Partition Overrun Partition TS Partition Processor #2 RT Partition Overrun Partition TS Partition

  9. Execution Phase Probing Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Adjusted Contract Execution Flow of a SRT Process

  10. Smart 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.

  11. 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 Conformance Test ? Iteration Number

  12. Execution Phase Probing Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Adjusted Contract Execution Flow of a DSRT Process

  13. Conformance Test (1) Processor Usage Nonconformance Conformance Burst Tolerance Reserved Usage

  14. Conformance Test (2) • SSBTR = System Specific Burst Tolerance Rate. PVPT Class PCPT Class Processor Usage Processor Usage SPT(1+SSBTR)+BT PPT(1+SSBTR) PPT(1+SSBTR) SPT Leak every P PPT Leak every P PPT Leak every P

  15. 12ms 50ms 62ms 10ms 55ms 40ms 60ms 5ms Smart Probing (3) • Compute average processor usage = 50ms • Compute peak processor usage = 62ms. • Max Burst = 12ms 50ms 40ms 62ms 43ms 55ms 50ms 50ms 50ms 50ms 50ms

  16. 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

  17. Execution Phase Probing Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Adjusted Contract Execution Flow of a DSRT Process

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

  19. Execution Phase Probing Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Execution Flow of a DSRT Process Adjusted Contract

  20. Proportional Sharing RT Scheduler Overrun Scheduler TS Scheduler Multi-Level Round Robin Priority Queues Kernel Scheduler Preemptive EDF Processor #1 RT Partition Overrun Partition TS Partition Processor #2 RT Partition Overrun Partition TS Partition Partition Scheduling Top-Level Scheduler

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

  22. 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 Overrun Partition Scheduler

  23. Execution Phase Probing Phase Reservation Phase Scheduling Probe Admission Control Extract Reservation Monitor/ Conformance Test Contract Processor Binding Adaptation SRT Process Adjusted Contract Execution Flow of a DSRT Process

  24. Adaptation Scene #1 Scene #2 • Adjust Reservation. • 3 Strategies • Exponential Average • Range • Statistical Frame 275

  25. X1 X2 X3 ... Xws-1 Xws Xws+1 ... X2ws ... X3ws Iteration Number Adaptation Points Exponential Average Adaptation Strategy • Specification: • Window Size (ws). • Alpha () • Xi= Guaranteed Parameter in a reservation. • Xi-1 = Actual Usage.

  26. X1 X2 X3 ... Xws-1 Xws Xws+1 ... X2ws ... X3ws Iteration Adaptation Points Statistical Adaptation Strategy • Specification: • Window Size (ws). • Overrun Tolerance Frequency (f). • Example: ws=10, f=20%. Adjust X=40ms.

  27. Implementation Building Blocks • A Real Time Timer. • setiimer() in Solaris and Irix. Lots of Timers in NT. • Fixed Real Time Priority. • priocntl() in Solaris, sched_setscheduler() in Irix, setPriorityClass() in NT. • Processor Affinity. • processor_bind() in Solaris, sysmp(MP_MUSTRUN_PID) in Irix, and setProcessAffinityMask() in NT.

  28. 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. DSRT Scheduler Process N (6) Timer interrupts Scheduler Dispatched Process N-1 . ....... (2) Set Processor Affinity. ....... . Time Sharing Processes (5) Decrease Priority . (1) Increase Priority. ....... Dynamic TS Priority ....... RT Process Pool 0 Lowest Priority

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

  30. Experiment • Dual Processor Sun Ultra 2 Machine. • Solaris 2.6 Operating System. • Dispatch Latency 400us. Includes • Scheduling Algorithm. • Context Switches. • Various system calls.

  31. 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).

  32. 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).

  33. Experimental Result SRT2: MPEG player with P=50ms. SRT1: MPEG player With P=100ms

  34. Experimental Result (Cont.) SRT3: Sampling program with P=50ms. SRT4: Java game with P=100ms.

  35. Conclusion • Multimedia needs strong support from the OS via scheduling policies, differentiation policies and mechanisms • Soft real-time guarantees can be made using priority mechanisms, but in a careful manner • Changes can be made via middleware systems or directly inside of kernels, but there are trade-offs

More Related