160 likes | 332 Views
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
E N D
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 • Problems with Soft Timers • Soft Timer Operations • Soft Timer Applications • Rate-Based Clocking • Network Polling • Experimental Results • Conclusion
Why Soft Timers ? • I/O Management can be done by: • Interrupts • + Low latency • - High context switching overhead • Polling • + Avoids Interrupts • - Possibility of high latency • Neither overheads acceptable for high performance time-sensitive applications. • Solution : Use Soft Timers
What are Soft Timers ? • New OS facility that allows efficient scheduling of software events. • Avoids interrupts and reduces context switches. • Enables efficient performance of rate-based clocking. • Can be used to perform network polling.
Conventional Timers • Invokes designated event handlers periodically in the context of a hardware interrupt. • Causes high CPU overhead due to: • Saving state and restoring state. • Cache/TLB pollution.
Soft Timer Mechanism • Before returning to user mode the kernel checks for and executes pending events. • Uses concept of trigger states. • System calls. • Exception handling (eg. TLB or page fault). • Interrupt handler associated with a device interrupt. • The CPU going idle. • No hardware interrupt.
Soft Timer Mechanism (contd.) • Invoking event handler equivalent to function call. • Soft timer facility checks for pending soft timer events . • Associated handler invoked without cost of hardware interrupt. • Soft Timer checks have no significant impact on system performance.
Problems with Soft Timers • Invoking of event handler may be delayed past its scheduled time. • Trade-off between accuracy and overhead. • Solution: Maximal delay experienced by a soft timer is bounded - low frequency hardware timer schedules overdue events. • Events scheduled at a much finer granularity than periodic hardware interrupts Soft timer polling latency Trigger states Event Scheduled
Soft Timer Operations • Measure_resolution() – returns the 64-bit resolution (in Hz) of the clock . • Measure_time() – returns the 64-bit current real time . • Schedule_soft_event (T, h) – schedules handler h to be called at least T ticks in future. • Interrupt_clock_resolution() – gives the expected minimal resolution (in Hz). Equal to frequency of “back up” timer interrupt. ( Interval > T + 1 ) => event fired X = measure_time() Event Scheduled
Soft Timer Applications - Rate-Based Clocking • Packet Transmission at a scheduled rate. • Current TCP implementations are self- clocking. • Essential for TCP implementations: • Allows sender to skip slow-start phase. • Overcomes effects of ACK compression and big ACKs. • Increases network utilization and performance on high speed WANs. • Conventional approach – schedule periodic hardware timer events – unacceptable overheads.
Rate Based Clocking using Soft Timers • Soft timers allow clocked transmission of packets with low overhead. • Algorithm used: • Protocol maintains running average of actual transmission rate. • Events scheduled to achieve target transmission rate. • If actual rate < target rate, then next transmission interval = maximum allowable rate.
Soft Timer Applications – Network Polling • System periodically reads network interfaces’ status registers. • Avoids interrupts. • May increase latency. • Use hybrid approach – interrupts under normal network load and polling under overload.
Soft Timer Based Network Polling • Algorithm used: • Soft timer event polls network interface. • Avoids network interrupts. • Improves memory access locality. • Communication latency similar to interrupt-driven network processing. • Aggregation quota dynamically selected.
Experimental Results off-chip timer on-chip timer • Hardware timer overhead does not scale with CPU speed. • Relative cost increases as CPU gets faster. • Base overhead imposed by soft timer is negligible.
Conclusion • 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.