Transcript ppt

Soft Timers: Efficient Microsecond
Software Timer Support for Network
Processing
Mohit Aron and Peter Druschel
Presented by
Kristen Carlson Accardi
Presentation Topics




What Problems are we trying to solve
What is a Soft Timer
How do Soft Timers solve our problem
Conclusions
CS533 - Concepts of Operating Systems
2
What problem are we trying to solve

Interrupt overhead
o
o
o

Context switching
Cache misses & pollution
TLB misses & pollution
Efficient implementation of proposed optimizations
for networking
o
Event generation at microsecond granularity without
increasing overhead
CS533 - Concepts of Operating Systems
3
Operation of Traditional timers





Hardware based
o Software will program a chip that will interrupt the CPU
either after a given amount of time, or at a regular
frequency.
Each interrupt causes a context switch into kernel mode
Interrupt service routine then runs, uses Cache and TLB,
missing both initially
Process resumes on exit from the ISR, and process may now no
longer have relevant information in cache/TLB
o This is known as cache & TLB pollution
For Fine grained timers, this would have to happen very
frequently
CS533 - Concepts of Operating Systems
4
Generating Events without a Timer (sorta)




Amortize the overhead by using “trigger states” that already
exist in the system to generate a soft timer event
Soft timer events are just a function call to a handler
Hardware timers are used to guarantee an upper bound on the
interval
Soft Timers allow us to reduce granularity of the clock without
adding more interrupt overhead
CS533 - Concepts of Operating Systems
5
Trigger Events in the system


Syscalls, page faults, interrupt handlers, idle loop
This is dependent on the workload of the system and
how fast the CPU is.
CS533 - Concepts of Operating Systems
6
TCP protocol has shortcomings on high
bandwidth – high latency networks




Long RTT causes window based congestion control
algorithm to mistakenly assume the network is
congested.
Slow start algorithm also doesn’t work well on high
latency networks.
Fairness is compromised because the connections
with a shorter RTT will be given more bandwidth
Delayed ACKs or Compressed ACKs can cause bursty
behavior and increase congestion
CS533 - Concepts of Operating Systems
7
Rate-based Clocking for TCP

Rate based clocking has been proposed as a method
of alleviating these issues.
o

Rate based clocking requires sending packets at a
rate of 1 every few tens of microseconds
o
o

Packets are sent out at a specified rate regardless of the
ACKs received.
The higher bandwidth the network the faster the rate
With hardware timers, this causes a lot of overhead
Soft Timers can be used to reduce the number of
interrupts this implementation would cause
CS533 - Concepts of Operating Systems
8
Implementing Rate-based Clocking with
Soft Timers


Keep track of desired transmission rate
Keep track of maximum allowable number of packets
that can be transmitted in a burst
o

Just in case time between events is longer
Schedule rate of transmission to sustain an average
which achieves the desired transmission rate
CS533 - Concepts of Operating Systems
9
Network Interrupt Processing Overhead




Normally 2 interrupts per packet
On High speed networks interrupts will occur every
few microseconds
Other processes will starve
System performance suffers due to context
switches and cache/TLB misses
CS533 - Concepts of Operating Systems
10
Network Polling

Removes interrupt overhead by scheduling periodic
checks for new packets
o
o

Normal scheduling doesn’t allow for a small enough
period of time between polling intervals
o

Allows batch processing of packets
Other processes can run
Most implementations use Interrupts when network is slow,
and switch to Polling mode when network is loaded
Soft timers provide small granularity so that
interrupts are only needed with CPU is not loaded.
CS533 - Concepts of Operating Systems
11
Network Polling Performance
CS533 - Concepts of Operating Systems
12
Effect of removing sources of events
CS533 - Concepts of Operating Systems
13
Conclusions


Soft timers reduce cache & TLB pollution
Soft timers can provide fine grained timer events
due to frequency of trigger states
o
o

which allows Network Polling.
Removing network interrupts will still result in sufficient
number of trigger states
Software timers reduce overhead in rate-based
packet transmission
o
Even with use of hardware timer as way of guaranteeing
upper bound.
CS533 - Concepts of Operating Systems
14