17
Supporting Time- sensitive Application on a Commodity OS By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Shuping Tien

Supporting Time-sensitive Application on a Commodity OS

Embed Size (px)

DESCRIPTION

Supporting Time-sensitive Application on a Commodity OS. By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Shuping Tien. Overview. Motivation Goal Approach Implement TSL Firm timer Fine-Grain Kernel Preemptibility Improved CPU scheduling Evaluation - PowerPoint PPT Presentation

Citation preview

Page 1: Supporting Time-sensitive Application on a Commodity OS

Supporting Time-sensitive Application on a Commodity OS

By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole

Presenter: Shuping Tien

Page 2: Supporting Time-sensitive Application on a Commodity OS

Overview

Motivation Goal Approach Implement TSL

Firm timer Fine-Grain Kernel Preemptibility Improved CPU scheduling

Evaluation Conclusion

Page 3: Supporting Time-sensitive Application on a Commodity OS

Motivation

Increasing use of time-sensitive application on general-purpose OS

Most commodity OS targeting to have max system throughput, or only focusing on hard real-time application performance System throughput decreases

Page 4: Supporting Time-sensitive Application on a Commodity OS

Goal

Satisfying time-sensitive application time constraint Attempt to integrate support for time-sensitive

applications without sacrificing performance of traditional throughput-oriented applications

Build Time-Sensitive Linux (TSL) While support time-sensitive application, not degrade

throughput-oriented application

Page 5: Supporting Time-sensitive Application on a Commodity OS

Approach

Time-sensitive applications require Timely resources allocation Low kernel latency : Timer latency + preemption

latency + scheduling latency

Time

Wall-clock timeevent

TimerInterrupt

Scheduler Application Scheduled(Activation)

InterruptHandler

Another appScheduled

Timer LatencyPreemption

Latency Scheduling Latency

Page 6: Supporting Time-sensitive Application on a Commodity OS

Approach

Improve the three keys causing latency Accurate timing mechanism

Firm timer Responsive kernel

Lock-breaking preemptible kernel Effective CPU scheduling algorithm

Proportion-period scheduler Priority-based scheduler

Page 7: Supporting Time-sensitive Application on a Commodity OS

Timer Mechanism

Periodic Timers Periodic timer interrupts. Max timer latency equals to the period. Reducing latency increases interrupt overhead

One-Shot (Hard) Timers Interrupts only when needed Cost of timer reprogramming, fielding interrupts

Soft Timers Reduce cost of context switch caused by interrupts Cost of polling, timer latency

Firm Timers Combines all the advantages of these timers above Incurs very low overhead

Page 8: Supporting Time-sensitive Application on a Commodity OS

Firm Timer design

Providing accurate timing mechanism with low overhead Combining one-shot timers with soft timers by exposing

a timer overshoot parameter bounding the latency. Programming one-shot timer 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 one-shot timer generate interrupt when soft timer is effective.

Reprogramming one-shot timer for the next timer expiry – not incur overhead

Page 9: Supporting Time-sensitive Application on a Commodity OS

Overshoot accuracy vs. overhead tradeoff

Kernel Space

Time

System call

Time-SensitiveApplication require

execution

Reprogram timer

Poll for timerexpiry

Overshoot Parameter

Dispatching timer

Timer Latency

Page 10: Supporting Time-sensitive Application on a Commodity OS

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 and 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 due to

more efficient data structure TSL use the standard POSIX interface calls - modified the

implementation to use firm timers

Page 11: Supporting Time-sensitive Application on a Commodity OS

Fine-grained kernel preemptibility Problem:

Larger size of non-preemptible secion results in greater kernel latency

Approaches: Explicit insertion of preemption points Allow preemption anytime the kernel is not accessing

shared data structures Robert Love’s lock-breaking preemptible kernel

Page 12: Supporting Time-sensitive Application on a Commodity OS

CPU Scheduling

Firm timer uses a combination of Proportion-Period CPU Scheduling Priority CPU Scheduling

Page 13: Supporting Time-sensitive Application on a Commodity OS

Proportion-period CPU Scheduling

Provides “temporal protection” by allocating each task a fixed proportion of the CPU at each task period

Adjustable Q and T by using a feedback controller mechanism

Improves accuracy of scheduling analysis

T1

T2

2/3

1/3

Proportion Q

Proportion Q

Time

Time

Period T

Page 14: Supporting Time-sensitive Application on a Commodity OS

Priority-based 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

Page 15: Supporting Time-sensitive Application on a Commodity OS

Evaluation- Latency in Real Application Kernel CPU load

Page 16: Supporting Time-sensitive Application on a Commodity OS

Evaluation- System Overhead

Cost of executing firm timers

Page 17: Supporting Time-sensitive Application on a Commodity OS

Conclusion

TSL can support applications requiring fine-grained resource allocation and low latency

TSL provides effective supports to both time-sensitive and throughput-oriented applications as a general purpose operating system