Upload
omar-welch
View
22
Download
0
Embed Size (px)
DESCRIPTION
Soft Timers: Efficient Microsecond Software Timer Support For Network Processing. Mohit Aron and Peter Druschel Rice University. Presented By Oindrila Mukherjee. Outline. Why Soft Timers? What are Soft Timers? Conventional Timers and Associated Problems Soft Timer Mechanism - PowerPoint PPT Presentation
Citation preview
11
Soft Timers: Efficient Microsecond Soft Timers: Efficient Microsecond Software Timer Support For Network Software Timer Support For Network
ProcessingProcessing
Mohit Aron and Peter DruschelMohit Aron and Peter DruschelRice UniversityRice University
Presented By
Oindrila Mukherjee
22
OutlineOutline
Why Soft Timers?Why Soft Timers? What are Soft Timers?What are Soft Timers? Conventional Timers and Associated Conventional Timers and Associated
ProblemsProblems Soft Timer MechanismSoft Timer Mechanism Problems with Soft TimersProblems with Soft Timers Soft Timer OperationsSoft Timer Operations Soft Timer ApplicationsSoft Timer Applications
Rate-Based ClockingRate-Based Clocking Network PollingNetwork Polling
Experimental ResultsExperimental Results ConclusionConclusion
33
Why Soft Timers ?Why Soft Timers ?
I/O Management can be done by:I/O Management can be done by: InterruptsInterrupts
+ Low latency+ Low latency - High context switching overhead- High context switching overhead
PollingPolling + Avoids Interrupts+ Avoids Interrupts - Possibility of high latency- Possibility of high latency
Neither overheads acceptable for high Neither overheads acceptable for high performance time-sensitive applications.performance time-sensitive applications.
Solution : Use Soft TimersSolution : Use Soft Timers
44
What are Soft Timers ?What are Soft Timers ?
New OS facility that allows New OS facility that allows efficient scheduling of software efficient scheduling of software events.events.
Avoids interrupts and reduces Avoids interrupts and reduces context switches.context switches.
Enables efficient performance of Enables efficient performance of rate-based clocking.rate-based clocking.
Can be used to perform network Can be used to perform network polling.polling.
55
Conventional TimersConventional Timers
Invokes designated event Invokes designated event handlers periodically in the handlers periodically in the context of a hardware interrupt.context of a hardware interrupt.
Causes high CPU overhead due Causes high CPU overhead due to:to: Saving state and restoring state.Saving state and restoring state. Cache/TLB pollution.Cache/TLB pollution.
66
Soft Timer MechanismSoft Timer Mechanism
Before returning to user mode the Before returning to user mode the kernel checks for and executes kernel checks for and executes pending events.pending events.
Uses concept of Uses concept of trigger states.trigger states. System calls.System calls. Exception handling (eg. TLB or page Exception handling (eg. TLB or page
fault).fault). Interrupt handler associated with a Interrupt handler associated with a
device interrupt.device interrupt. The CPU going idle.The CPU going idle.
No hardware interrupt.No hardware interrupt.
77
Soft Timer Mechanism Soft Timer Mechanism (contd.)(contd.) Invoking event handler equivalent to Invoking event handler equivalent to
function call.function call. Soft timer facility checks for pending Soft timer facility checks for pending
soft timer events .soft timer events . Associated handler invoked without Associated handler invoked without
cost of hardware interrupt.cost of hardware interrupt. Soft Timer checks have no Soft Timer checks have no
significant impact on system significant impact on system performance.performance.
88
Problems with Soft TimersProblems with Soft Timers Invoking of event handler may be delayed past its Invoking of event handler may be delayed past its
scheduled time.scheduled time. Trade-off between accuracy and overhead.Trade-off between accuracy and overhead.
Solution:Solution: Maximal delay experienced by a soft timer is Maximal delay experienced by a soft timer is bounded - low frequency hardware timer bounded - low frequency hardware timer
schedules schedules overdue events.overdue events.
Events scheduled at a much finer granularity than periodic Events scheduled at a much finer granularity than periodic hardware interruptshardware interrupts
Event Scheduled
Soft timer polling
latency Trigger states
99
Soft Timer OperationsSoft Timer Operations
Measure_resolution() – returns the 64-bit Measure_resolution() – returns the 64-bit resolution (in Hz) of the clock .resolution (in Hz) of the clock .
Measure_time() – returns the 64-bit current Measure_time() – returns the 64-bit current real time .real time .
Schedule_soft_event (T, h) – schedules Schedule_soft_event (T, h) – schedules handler h to be called at least T ticks in handler h to be called at least T ticks in future.future.
Interrupt_clock_resolution() – gives the Interrupt_clock_resolution() – gives the expected minimal resolution (in Hz). Equal expected minimal resolution (in Hz). Equal to frequency of “back up” timer interrupt.to frequency of “back up” timer interrupt.
Event Scheduled X = measure_time()
( Interval > T + 1 ) => event fired
1010
Soft Timer Applications - Soft Timer Applications - Rate-Based ClockingRate-Based Clocking Packet Transmission at a scheduled rate.Packet Transmission at a scheduled rate. Current TCP implementations are self- Current TCP implementations are self-
clocking.clocking. Essential for TCP implementations:Essential for TCP implementations:
Allows sender to skip slow-start phase.Allows sender to skip slow-start phase. Overcomes effects of ACK compression and big Overcomes effects of ACK compression and big
ACKs.ACKs. Increases network utilization and Increases network utilization and
performance on high speed WANs.performance on high speed WANs. Conventional approach – schedule periodic Conventional approach – schedule periodic
hardware timer events – unacceptable hardware timer events – unacceptable overheads.overheads.
1111
Rate Based Clocking using Rate Based Clocking using Soft TimersSoft Timers Soft timers allow clocked Soft timers allow clocked
transmission of packets with low transmission of packets with low overhead.overhead.
Algorithm used:Algorithm used: Protocol maintains running average of Protocol maintains running average of
actual transmission rate.actual transmission rate. Events scheduled to achieve target Events scheduled to achieve target
transmission rate.transmission rate. If actual rate < target rate, thenIf actual rate < target rate, then
next transmission interval = maximum next transmission interval = maximum allowable rate.allowable rate.
1212
Soft Timer Applications – Soft Timer Applications – Network PollingNetwork Polling
System periodically reads System periodically reads network interfaces’ status network interfaces’ status registers.registers.
Avoids interrupts.Avoids interrupts. May increase latency.May increase latency. Use hybrid approach – Use hybrid approach –
interrupts under normal network interrupts under normal network load and polling under overload.load and polling under overload.
1313
Soft Timer Based Network Soft Timer Based Network PollingPolling Algorithm used:Algorithm used:
Soft timer event polls network Soft timer event polls network interface.interface.
Avoids network interrupts.Avoids network interrupts. Improves memory access locality.Improves memory access locality. Communication latency similar to Communication latency similar to
interrupt-driven network interrupt-driven network processing.processing.
Aggregation quota dynamically Aggregation quota dynamically selected.selected.
1414
Experimental ResultsExperimental Results
Hardware timer overhead does not scale Hardware timer overhead does not scale with CPU speed.with CPU speed.
Relative cost increases as CPU gets faster.Relative cost increases as CPU gets faster. Base overhead imposed by soft timer is Base overhead imposed by soft timer is
negligible.negligible.
off-chip timer on-chip timer
1515
Experimental Results (contd.)Experimental Results (contd.)
1616
ConclusionConclusion
Soft timers allow the efficient scheduling of events at granularity below that of conventional timers.
Useful range of soft timer event granularity appears to widen as CPUs get faster.
They take advantage of trigger states and invokes handlers at low cost.
Soft timers can be integrated with an existing conventional interval timer facility.