Download presentation
Presentation is loading. Please wait.
Published byMorgan Richardson Modified over 5 years ago
1
Supporting Time-Sensitive Applications on a Commodity OS
Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Madhura S Rama
2
Agenda Goal Why TSL? Time Sensitive Requirements TSL Implementation
Firm Timers Fine-Grain Kernel Preemptibility CPU Scheduling Experimental Results Conclusion
3
Goal Integrate efficient support for time-sensitive applications in a commodity OS without significantly degrading the performance of traditional applications.
4
Why TSL? Soft real-time applications are time sensitive
Resources must be allocated at appropriate times Commodity OS provides coarse-grained resource allocation to maximize throughput Conflicts the needs of RTOS Time-sensitive Linux (TSL) - provides good performance to both time-sensitive and throughput–oriented applications.
5
Time Sensitive Requirements
Allocate resources at “appropriate times” Kernel latency – latency between the event and its activation Should be low in a time-sensitive application Three requirements to reduce this latency Preemption Latency Timer Latency Scheduling Latency Time Interrupt Handler Another app Scheduled Wall-clock time event Timer Interrupt Scheduler Application Scheduled (Activation)
6
Different Timers Periodic Timers One-Shot (Hard) Timers Soft Timers
Implemented with Periodic timer interrupts. Max 10ms latency Decrease in latency increases interrupt overhead One-Shot (Hard) Timers Interrupts only when needed Timer reprogramming, fielding interrupts Soft Timers Avoids interrupts Cost of polling, timer latency Firm Timers Combines all the advantages of the above timers Incurs very low overhead
7
Three key techniques Accurate Timing Mechanism Responsive Kernel
Firm Timers Responsive Kernel Lock-breaking preemptible kernel Appropriate CPU Scheduling Algorithm Proportion-Period Scheduler Priority-based Scheduler
8
Firm Timers Provides accurate timing mechanism with low overhead
Combines one-shot timers with soft timers by exposing a timer overshoot parameter One-shot timer is programmed to fire after an overshoot amount of time after the next timer expiry If a system call occurs after a timer has expired but before the one-shot timer expired, soft timers become effective. Reprogram the one-shot timer for the next timer expiry – does not incur any overhead
9
Overshoot Accuracy vs Overhead tradeoff
Reprogram One-shot timer and fire the event Poll for timer expiry User Space System call Kernel Space Overshoot Parameter Time Time-Sensitive Application ready For execution One-shot timer expiry Timer Latency
10
Firm Timer Implementation
Maintains a timer queue for each processor One-shot APIC timer is programmed to generate an interrupt at the next timer expiry event + global overshoot value (can be made dynamic) Soft timers enabled using non-zero timer overshoot value Periodic timer used when a timer needs longer timeout TSL use the standard POSIX interface calls - modified the implementation to use firm timers
11
Fine-Grained Kernel Premptibility
Kernel latency increases with increase in the length of the non-preemptible critical section Approaches to reduce kernel latency Explicit insertion of preemption points Allow preemption anytime the kernel is not accessing shared data structures Robert Love’s lock-breaking preemptible kernel
12
CPU Scheduling Uses a combination of Proportion-Period CPU Scheduling
Priority CPU Scheduling
13
Proportion-Period CPU Scheduling
Provides “temporal protection” by allocating each task a fixed proportion of the CPU at each task period Proportion can be assigned either statically or dynamically using a feedback mechanism Improves accuracy of scheduling analysis 2/3 T1 Proportion Time Period 1/3 T2 Time Proportion
14
Priority CPU Scheduling
Real-time priorities assigned based on application needs TSL schedules fixed priority tasks in the background Exception: Shared server tasks -> Priority Inversion Use Highest locking priority protocol (HLP) to cope with priority inversion Minimizes scheduling Latency
15
Latency in Real Applications
16
System Overhead
17
Conclusion TSL can support applications requiring fine-grained resource allocation and low latency TSL is truly a general-purpose system – can be used effectively for both time-sensitive and throughput-oriented applications
18
Backup Experimental Results
Firm timers are effective in reducing the overhead of one-shot timers when the ratio of number of the soft timers that fire to the number of soft timer checks is sufficiently large (2.1%) Overhead of TSL on throughput-oriented applications is low Provides allocation to time-sensitive applications with a variation of less than 400 usec even under heavy load.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.