Title: Dynamic Soft Real Time Scheduling DSRT System
1Dynamic Soft Real Time Scheduling (DSRT) System
2Problem 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, ...
3DSRT 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.
4DSRT Concepts
- CPU Service Classes
- Mapping CPU Service Classes into a Multiprocessor
Partitioning Design - Execution Flow of a SRT Process
5CPU Service Classes
6Periodic Constant Processing Time Class
Peak Processing Time10ms Period 100ms
0
10
110
210
100
200
Time(ms)
7Periodic Variable Processing Time Class
Period 100ms Peak Processing Time
30ms Sustainable Processing Time 15ms Burst
Tolerance 7ms
Time(ms)
8Multiprocessor Partitioning Design
Guaranteed Part
Non-guaranteed Part
PCPT Processes
Reserved Run
Overrun
PVPT Processes
TS Processes
Burst
Reserved Run
Overrun
RT Scheduler
Overrun Scheduler
TS Scheduler
Processor 1
RT Partition
Overrun Partition
TS Partition
Processor 2
RT Partition
Overrun Partition
TS Partition
9Execution Flow of a SRT Process
10Smart 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.
11Smart 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
12Execution Flow of a DSRT Process
13Conformance Test (1)
Processor Usage
Nonconformance
Conformance
Burst Tolerance
Reserved Usage
14Conformance Test (2)
- SSBTR System Specific Burst Tolerance Rate.
PVPT Class
PCPT Class
Processor Usage
Processor Usage
SPT(1SSBTR)BT
PPT(1SSBTR)
PPT(1SSBTR)
SPT Leak every P
PPT Leak every P
PPT Leak every P
15Smart 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
16Smart Probing (4)
- SSBTR 10
- Average Processor Usage SSBTR 5ms
- If Max Burst lt 5ms
- Constant Processing Time Class
- else if Max Burst (12ms) gt 5ms,
- Variable Processing Time Class
- Sustainable Processing Time 50ms
- Peak Processing Time 62ms
- Burst Tolerance 12ms - 5ms 7ms
17Execution Flow of a DSRT Process
18Admission Control Test
- Given a reservation request, determine
- Resource Availability. (1) (2)
- Processor Binding. (2)
- Preemptive Earliest Deadline First
19Execution Flow of a DSRT Process
Adjusted Contract
20Partition Scheduling
Top-Level Scheduler
21RT 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
22Overrun Partition Scheduler
23Execution Flow of a DSRT Process
24Adaptation
Scene 2
Scene 1
- Adjust Reservation.
- 3 Strategies
- Exponential Average
- Range
- Statistical
Frame 275
25Exponential Average Adaptation Strategy
- Specification
- Window Size (ws).
- Alpha (?)
- Xi Guaranteed Parameter in a reservation.
- Xi-1 Actual Usage.
26Statistical Adaptation Strategy
- Specification
- Window Size (ws).
- Overrun Tolerance Frequency (f).
- Example ws10, f20. Adjust X40ms.
27Implementation 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.
28User-level Priority Dispatch
29C APIs
- CpuApi cpu
- CpuReservation reservation
- // Probing Phase
- cpu.probe()
- cpu.start()
- for (int i0 iltnumProbeIterations 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()
30Experiment
- Dual Processor Sun Ultra 2 Machine.
- Solaris 2.6 Operating System.
- Dispatch Latency 400us. Includes
- Scheduling Algorithm.
- Context Switches.
- Various system calls.
31Experiment 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, P100ms,
- SPT28ms, PPT40ms, BT11ms).
- Adaptation Strategy (Statistical,
- f 20, ws 20).
32Experimental Setup (Cont.)
- SRT2 A MPEG player at 20 FPS.
- Probing (PVPT class, P50ms,
- SPT14ms, PPT21ms, BT6ms)
- SRT3 A sampling program.
- Probing(PCPT class, P50ms,
- PPT10ms)
- SRT4 A Java RocksInSpace game.
- (PCPT class, P100ms, PPT30ms).
- SRT5 Misbehaving greedy program.
- (PCPT class, P500ms, PPT10ms).
33Experimental Result
SRT2 MPEG player with P50ms.
SRT1 MPEG player With P100ms
34Experimental Result (Cont.)
SRT3 Sampling program with P50ms.
SRT4 Java game with P100ms.
35Conclusion
- 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