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

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 Oindrila."— Presentation transcript:

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

2 2 Outline Why Soft Timers? Why Soft Timers? What are Soft Timers? What are Soft Timers? Conventional Timers and Associated Problems Conventional Timers and Associated Problems Soft Timer Mechanism Soft Timer Mechanism Problems with Soft Timers Problems with Soft Timers Soft Timer Operations Soft Timer Operations Soft Timer Applications Soft Timer Applications Rate-Based Clocking Rate-Based Clocking Network Polling Network Polling Experimental Results Experimental Results Conclusion Conclusion

3 3 Why Soft Timers ? I/O Management can be done by: I/O Management can be done by: Interrupts Interrupts + Low latency + Low latency - High context switching overhead - High context switching overhead Polling Polling + Avoids Interrupts + Avoids Interrupts - Possibility of high latency - Possibility of high latency Neither overheads acceptable for high performance time-sensitive applications. Neither overheads acceptable for high performance time-sensitive applications. Solution : Use Soft Timers Solution : Use Soft Timers

4 4 What are Soft Timers ? New OS facility that allows efficient scheduling of software events. New OS facility that allows efficient scheduling of software events. Avoids interrupts and reduces context switches. Avoids interrupts and reduces context switches. Enables efficient performance of rate-based clocking. Enables efficient performance of rate-based clocking. Can be used to perform network polling. Can be used to perform network polling.

5 5 Conventional Timers Invokes designated event handlers periodically in the context of a hardware interrupt. Invokes designated event handlers periodically in the context of a hardware interrupt. Causes high CPU overhead due to: Causes high CPU overhead due to: Saving state and restoring state. Saving state and restoring state. Cache/TLB pollution. Cache/TLB pollution.

6 6 Soft Timer Mechanism Before returning to user mode the kernel checks for and executes pending events. Before returning to user mode the kernel checks for and executes pending events. Uses concept of trigger states. Uses concept of trigger states. System calls. System calls. Exception handling (eg. TLB or page fault). Exception handling (eg. TLB or page fault). Interrupt handler associated with a device interrupt. Interrupt handler associated with a device interrupt. The CPU going idle. The CPU going idle. No hardware interrupt. No hardware interrupt.

7 7 Soft Timer Mechanism (contd.) Invoking event handler equivalent to function call. Invoking event handler equivalent to function call. Soft timer facility checks for pending soft timer events. Soft timer facility checks for pending soft timer events. Associated handler invoked without cost of hardware interrupt. Associated handler invoked without cost of hardware interrupt. Soft Timer checks have no significant impact on system performance. 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. Invoking of event handler may be delayed past its scheduled time. Trade-off between accuracy and overhead. Trade-off between accuracy and overhead. Solution: Solution: Maximal delay experienced by a soft timer is bounded - low frequency hardware timer schedules overdue events. 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 Events 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_resolution() – returns the 64-bit resolution (in Hz) of the clock. Measure_time() – returns the 64-bit current real time. 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. 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. 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. Packet Transmission at a scheduled rate. Current TCP implementations are self- clocking. Current TCP implementations are self- 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 ACKs. Overcomes effects of ACK compression and big ACKs. Increases network utilization and performance on high speed WANs. Increases network utilization and performance on high speed WANs. Conventional approach – schedule periodic hardware timer events – unacceptable overheads. 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. Soft timers allow clocked transmission of packets with low overhead. Algorithm used: Algorithm used: Protocol maintains running average of actual transmission rate. Protocol maintains running average of actual transmission rate. Events scheduled to achieve target transmission rate. Events scheduled to achieve target transmission rate. If actual rate < target rate, then 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. System periodically reads network interfaces’ status registers. Avoids interrupts. Avoids interrupts. May increase latency. May increase latency. Use hybrid approach – interrupts under normal network load and polling under overload. Use hybrid approach – interrupts under normal network load and polling under overload.

13 13 Soft Timer Based Network Polling Algorithm used: Algorithm used: Soft timer event polls network interface. Soft timer event polls network interface. Avoids network interrupts. Avoids network interrupts. Improves memory access locality. Improves memory access locality. Communication latency similar to interrupt-driven network processing. Communication latency similar to interrupt-driven network processing. Aggregation quota dynamically selected. Aggregation quota dynamically selected.

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

15 15 Experimental Results (contd.) 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 Oindrila."

Similar presentations


Ads by Google