Check out the new USENIX Web site. next up previous
Next: 4.2 Cache Behavior Up: 4 Evaluation Previous: 4 Evaluation

4.1 Locking Overhead


Table 1: Percentage of lock acquisitions for global TCP/IP locks that do not succeed immediately.
OS Type 6 conns 192 conns 16384 conns
MsgP 89 100 100
ConnP-L(4) 60 56 52
ConnP-L(8) 51 30 26
ConnP-L(16) 49 18 14
ConnP-L(32) 41 10 7
ConnP-L(64) 37 6 4
ConnP-L(128) 33 5 2


Both lock latency and contention are significant sources of overhead within parallelized network stacks. Within the network stack, there are both global and individual locks. Global locks protect hash tables that are used to access individual connections, and individual locks protect only one connection. A thread must acquire a global lock to look up and access an individual lock. During contention for these global locks, other threads are blocked from entering the associated portion of the network stack, limiting parallelism.

Table 1 depicts global TCP/IP lock contention, measured as the percentage of lock acquisitions that do not immediately succeed because another thread holds the lock. ConnP-T is omitted from the table because it eliminates global TCP/IP locking completely. The MsgP network stack experiences significant contention for global TCP/IP locks. The Connection Hashtable lock protecting individual Connection locks is particularly problematic. Lock profiling shows that contention for Connection locks decreases with additional connections, but that the cost for contention for these locks increases because as the system load increases, they are held longer. Hence, when a Connection lock is contended (usually between the kernel's inbound protocol thread and an application's sending thread), a thread blocks longer holding the global Connection Hashtable lock, preventing other threads from making progress.

Figure 2: Aggregate network throughput for ConnP-L as the number of locks is varied.
\begin{figure}\centering
\epsfig{figure=Plots/connpl_scaling_6nic_direct.eps, width=\columnwidth}
\vspace*{-.25in}
{ }
\end{figure}

Whereas the MsgP stack relies on repeated acquisition of the Connection Hashtable and Connection locks, ConnP-L stacks can also become bottlenecked if a single connection group becomes highly contended. Table 1 shows the contention for the Network Group locks for ConnP-L stacks as the number of network groups is varied. Though ConnP-L(4)'s Network Group lock contention is high at over 50% for all connection loads, increasing the number of groups to 128 reduces contention from 52% to just 2% for the heaviest load. Figure 2 shows the effect that increasing the number of network groups has on aggregate throughput. As is suggested by reduced Network Group lock contention, throughput generally increases as groups are added, although with diminishing returns.


next up previous
Next: 4.2 Cache Behavior Up: 4 Evaluation Previous: 4 Evaluation