cvs commit: src/sys/netinet udp_usrreq.c

Robert Watson rwatson at FreeBSD.org
Mon Jul 7 11:14:18 UTC 2008


On Mon, 7 Jul 2008, Robert Watson wrote:

> rwatson     2008-07-07 10:56:55 UTC
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/netinet          udp_usrreq.c
>  Log:
>  SVN rev 180344 on 2008-07-07 10:56:55Z by rwatson
>
>  First step towards parallel transmit in UDP: if neither a specific
>  source or a specific destination address is requested as part of a send
>  on a UDP socket, read lock the inpcb rather than write lock it.  This
>  will allow fully parallel transmit down to the IP layer when sending
>  simultaneously from multiple threads on a connected UDP socket.
>
>  Parallel transmit for more complex cases, such as when sendto(2) is
>  invoked with an address and there's already a local binding, will
>  follow.

This change doesn't help the particularly interesting applications, such as 
named, etc, as they usually call sendto() with an address rather than 
connect() the UDP socket, but upcoming changes should address that.  Once you 
get to the IP layer, the routing code shows up as a massive source of 
contention, and it would be great if someone wanted to work on improving 
concurrency for routing lookups.  Re-introducing the route cache for inpcbs 
would also help the connect() case, but not the sendto() case, but is still a 
good idea as it would help TCP a *lot*.  Once you get below the IP layer, 
contention on device driver transmit locks appears to be the next major 
locking-related performance issue.  The UDP changes I'm in the throes of 
merging have lead to significant performance improvements for UDP 
applications, such as named and memcached, and hopefully can be MFC'd for 7.1 
or 7.2.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the cvs-src mailing list