210 likes | 360 Views
Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole. Jimi Watson. Why?. Time sensitive applications Enhancing resource allocation Throughput Insignificant degradation. Four keys. Timing mechanisms Timer latency
E N D
Supporting Time-Sensitive Applications on a Commodity OSbyAshvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson
Why? • Time sensitive applications • Enhancing resource allocation • Throughput • Insignificant degradation
Four keys • Timing mechanisms • Timer latency • Responsive Kernel • Preemption latency • CPU scheduling algorithm • Scheduling latency • Use them all
Timers • Periodic timers • The old model • Shortest period 10msec • One-shot timers • Interrupts at specific instance • Reprogram • Soft timers • Handles events at soft timer points
Timers Comparison • Hard timers • Interrupt handling • Cache pollution • Soft timers • Polling for expired events • Firm timers • Better precision • Fewer interupts
Firm Timers • Combination of soft and one shot timers • Use soft timers to reduce overhead • Use one-shot timers to ensure events are handled • Overshoot
Example of overshoot 0 5 10 Time Last event handled Next event Overshoot
Firm timer implementation • Timer queue • 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 • One shot timers only within 1 tick period • POSIX interface calls altered to take advantage of firm timers on TSL
Kernel preemptibility • May not be preemtible • Interrupts disabled • Executing in critical section • Solution • Shorten the length it is not preemptible • Explicit preemption points • Lock breaking preemtible kernel
Scheduling • Proportion-Period scheduling • Priority CPU scheduling
Proportion-Period scheduling • Temporal protection • Every time sensitive task requires specification of proportion and period • Proportion is how much CPU it needs • Period is how often the task needs CPU to guarantee proper function
Proportion Scheduling CPU CPU CPU CPU Time Periods
Priority scheduling • Priority assigned based on application needs • Run in the background • Priority inversion
Testing • Compare Linux, soft timers, hard timers and firm timers • Multiple applications • Each require 10 msec intervals
Testing • Difference between hard and firm timers • Firm timers have lower overhead when a percentage of soft timers fire per poll • Ns/Nc > 2.1 % • Variation > 400 usec under heavy loads • Low overhead on throughput loads
Conclusions • Better performance for all applications • Gracefully handles soft real time apps • Very little impact on throughput • Useful general purpose OS