supporting time-sensitive applications on a commodity os by ashvin goel, luca abeni, charles krasic,...
Post on 20-Dec-2015
217 views
TRANSCRIPT
![Page 1: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/1.jpg)
Supporting Time-Supporting Time-Sensitive Applications Sensitive Applications on a Commodity OSon a Commodity OS
bybyAshvin Goel, Luca Abeni, Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Charles Krasic, Jim Snow,
Jonathan WalpoleJonathan WalpoleJimi WatsonJimi Watson
![Page 2: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/2.jpg)
Why?Why?
Time sensitive applicationsTime sensitive applications– Enhancing resource allocationEnhancing resource allocation
ThroughputThroughput– Insignificant degradation Insignificant degradation
![Page 3: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/3.jpg)
Four keysFour keys
Timing mechanismsTiming mechanisms– Timer latencyTimer latency
Responsive KernelResponsive Kernel– Preemption latencyPreemption latency
CPU scheduling algorithmCPU scheduling algorithm– Scheduling latencyScheduling latency
Use them allUse them all
![Page 4: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/4.jpg)
![Page 5: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/5.jpg)
TimersTimers
Periodic timersPeriodic timers– The old modelThe old model– Shortest period 10msecShortest period 10msec
One-shot timersOne-shot timers– Interrupts at specific instanceInterrupts at specific instance– ReprogramReprogram
Soft timersSoft timers– Handles events at soft timer pointsHandles events at soft timer points
![Page 6: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/6.jpg)
Timers ComparisonTimers Comparison
Hard timersHard timers– Interrupt handlingInterrupt handling– Cache pollutionCache pollution
Soft timersSoft timers– Polling for expired eventsPolling for expired events
Firm timersFirm timers– Better precisionBetter precision– Fewer interuptsFewer interupts
![Page 7: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/7.jpg)
Firm TimersFirm Timers
Combination of soft and one shot Combination of soft and one shot timerstimers
Use soft timers to reduce overheadUse soft timers to reduce overhead Use one-shot timers to ensure events Use one-shot timers to ensure events
are handledare handled OvershootOvershoot
![Page 8: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/8.jpg)
Example of overshootExample of overshoot
Last eventhandled
Next event Overshoot
0 5 10 Time
![Page 9: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/9.jpg)
Firm timer implementationFirm timer implementation
Timer queueTimer queue APIC is set to next timer event plus global APIC is set to next timer event plus global
overshoot valueovershoot value– Possible to have overshoot for separate timersPossible to have overshoot for separate timers
Apps with tighter constraints incur penaltyApps with tighter constraints incur penalty Overhead is simply additional queue and overshootOverhead is simply additional queue and overshoot
Periodic timers used for long timeoutsPeriodic timers used for long timeouts– One shot timers only within 1 tick periodOne shot timers only within 1 tick period
POSIX interface calls altered to take POSIX interface calls altered to take advantage of firm timers on TSLadvantage of firm timers on TSL
![Page 10: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/10.jpg)
Kernel preemptibilityKernel preemptibility
May not be preemtibleMay not be preemtible– Interrupts disabledInterrupts disabled– Executing in critical sectionExecuting in critical section
SolutionSolution– Shorten the length it is not preemptibleShorten the length it is not preemptible– Explicit preemption pointsExplicit preemption points– Lock breaking preemtible kernelLock breaking preemtible kernel
![Page 11: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/11.jpg)
SchedulingScheduling
Proportion-Period schedulingProportion-Period scheduling Priority CPU schedulingPriority CPU scheduling
![Page 12: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/12.jpg)
Proportion-Period Proportion-Period schedulingscheduling
Temporal protectionTemporal protection Every time sensitive task requires Every time sensitive task requires
specification of proportion and periodspecification of proportion and period Proportion is how much CPU it needsProportion is how much CPU it needs Period is how often the task needs Period is how often the task needs
CPU to guarantee proper functionCPU to guarantee proper function
![Page 13: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/13.jpg)
Proportion SchedulingProportion Scheduling
CPU CPU CPU CPU
Periods
Time
![Page 14: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/14.jpg)
Priority schedulingPriority scheduling
Priority assigned based on Priority assigned based on application needsapplication needs
Run in the backgroundRun in the background Priority inversionPriority inversion
![Page 15: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/15.jpg)
Priority inversionPriority inversion
![Page 16: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/16.jpg)
TestingTesting
Compare Linux, soft timers, hard Compare Linux, soft timers, hard timers and firm timerstimers and firm timers
Multiple applications Multiple applications Each require 10 msec intervalsEach require 10 msec intervals
![Page 17: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/17.jpg)
20 processes, 10 msec20 processes, 10 msec
![Page 18: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/18.jpg)
50 processes , 10 msec50 processes , 10 msec
![Page 19: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/19.jpg)
20 processes, 1 msec20 processes, 1 msec
![Page 20: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/20.jpg)
TestingTesting
Difference between hard and firm Difference between hard and firm timerstimers– Firm timers have lower overhead when a Firm timers have lower overhead when a
percentage of soft timers fire per pollpercentage of soft timers fire per poll
– NNss/N/Ncc > 2.1 % > 2.1 %
Variation > 400 usec under heavy Variation > 400 usec under heavy loadsloads
Low overhead on throughput loadsLow overhead on throughput loads
![Page 21: Supporting Time-Sensitive Applications on a Commodity OS by Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Jimi Watson](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d535503460f94a2fbd7/html5/thumbnails/21.jpg)
ConclusionsConclusions
Better performance for all Better performance for all applicationsapplications
Gracefully handles soft real time Gracefully handles soft real time appsapps
Very little impact on throughputVery little impact on throughput Useful general purpose OSUseful general purpose OS