Download presentation
Presentation is loading. Please wait.
1
Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson
2
Why? Time sensitive applications Time sensitive applications –Enhancing resource allocation Throughput Throughput –Insignificant degradation
3
Four keys Timing mechanisms Timing mechanisms –Timer latency Responsive Kernel Responsive Kernel –Preemption latency CPU scheduling algorithm CPU scheduling algorithm –Scheduling latency Use them all Use them all
5
Timers Periodic timers Periodic timers –The old model –Shortest period 10msec One-shot timers One-shot timers –Interrupts at specific instance –Reprogram Soft timers Soft timers –Handles events at soft timer points
6
Timers Comparison Hard timers Hard timers –Interrupt handling –Cache pollution Soft timers Soft timers –Polling for expired events Firm timers Firm timers –Better precision –Fewer interupts
7
Firm Timers Combination of soft and one shot timers Combination of soft and one shot timers Use soft timers to reduce overhead Use soft timers to reduce overhead Use one-shot timers to ensure events are handled Use one-shot timers to ensure events are handled Overshoot Overshoot
8
Example of overshoot Last event handled Next eventOvershoot 0510 Time
9
Firm timer implementation Timer queue Timer queue APIC is set to next timer event plus global overshoot value APIC is set to next timer event plus global overshoot value –Possible to have overshoot for separate timers Apps with tighter constraints incur penalty Overhead is simply additional queue and overshoot Periodic timers used for long timeouts Periodic timers used for long timeouts –One shot timers only within 1 tick period POSIX interface calls altered to take advantage of firm timers on TSL POSIX interface calls altered to take advantage of firm timers on TSL
10
Kernel preemptibility May not be preemtible May not be preemtible –Interrupts disabled –Executing in critical section Solution Solution –Shorten the length it is not preemptible –Explicit preemption points –Lock breaking preemtible kernel
11
Scheduling Proportion-Period scheduling Proportion-Period scheduling Priority CPU scheduling Priority CPU scheduling
12
Proportion-Period scheduling Temporal protection Temporal protection Every time sensitive task requires specification of proportion and period Every time sensitive task requires specification of proportion and period Proportion is how much CPU it needs Proportion is how much CPU it needs Period is how often the task needs CPU to guarantee proper function Period is how often the task needs CPU to guarantee proper function
13
Proportion Scheduling CPU Periods Time
14
Priority scheduling Priority assigned based on application needs Priority assigned based on application needs Run in the background Run in the background Priority inversion Priority inversion
15
Priority inversion
16
Testing Compare Linux, soft timers, hard timers and firm timers Compare Linux, soft timers, hard timers and firm timers Multiple applications Multiple applications Each require 10 msec intervals Each require 10 msec intervals
17
20 processes, 10 msec
18
50 processes, 10 msec
19
20 processes, 1 msec
20
Testing Difference between hard and firm timers Difference between hard and firm timers –Firm timers have lower overhead when a percentage of soft timers fire per poll –N s /N c > 2.1 % Variation > 400 usec under heavy loads Variation > 400 usec under heavy loads Low overhead on throughput loads Low overhead on throughput loads
21
Conclusions Better performance for all applications Better performance for all applications Gracefully handles soft real time apps Gracefully handles soft real time apps Very little impact on throughput Very little impact on throughput Useful general purpose OS Useful general purpose OS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.