Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.

Similar presentations


Presentation on theme: "1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan."— Presentation transcript:

1 1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan Walpole

2 2 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

3 3 Why Soft Timers ? Device I/O can be done by: –Interrupts + Low latency - High context switching overhead –Polling + Avoids Interrupts - Possibility of high latency Clocks are no different –How can we support fine granularity timing with low latency and low overhead? Solution : Use Soft Timers

4 4 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.

5 5 Conventional Timers Invoke timer event handlers in response to a periodic hardware interrupt. Causes high CPU overhead due to: –Saving and restoring state. –Cache/TLB pollution. Period determines accuracy and overhead

6 6 Soft Timer Mechanism Before returning to user mode the kernel checks for and executes pending events. –Can read cycle counter to determine current time Polling takes place during 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 necessary

7 7 Soft Timer Mechanism (contd.) Overhead of invoking event handler is equivalent to a function call –Reading cycle counter costs only a few cycles 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.

8 8 Problems with Soft Timers Invoking of event handler may be delayed past its scheduled time. Trade-off between accuracy/predictability and overhead. Solution: Maximal delay experienced by a soft timer can be bounded using a low frequency hardware timer Events generally scheduled at a much finer granularity than periodic hardware interrupts Event Scheduled Soft timer polling latency Trigger states

9 9 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. Event Scheduled X = measure_time() ( Interval > T + 1 ) => event fired

10 10 Soft Timer Applications - Rate- Based Clocking Packet Transmission at a scheduled rate. Modern TCP implementations are self- clocking. –Increases network utilization and performance on high speed WANs. Conventional approach – schedule periodic hardware timer events – unacceptable overheads.

11 11 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.

12 12 Soft Timer Applications – Network Polling System periodically reads network interfaces’ status registers. Avoids interrupts. –But may increase latency. Use hybrid approach – interrupts under normal network load and polling under overload?

13 13 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.

14 14 Experimental Results Hardware timer overhead does not scale with CPU speed. Relative cost increases as CPU gets faster. Base overhead imposed by soft timer is negligible. off-chip timeron-chip timer

15 15 Experimental Results (contd.)

16 16 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.


Download ppt "1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan."

Similar presentations


Ads by Google