On Mon, Mar 06, 2006 at 02:01:11PM -0800, Benjamin LaHaise ([EMAIL PROTECTED]) wrote: > Hello again, > > This patch introduces the use of rcu for the ipv4 established connections > hashtable, as well as the timewait table since they are closely intertwined. > This removes 4 atomic operations per packet from the tcp_v4_rcv codepath, > which helps quite a bit when the other performance barriers in the system > are removed. Eliminating the rwlock cache bouncing should also help on SMP > systems. > > By itself, this improves local netperf performance on a P4/HT by ~260Mbit/s > on average. With smaller packets (say, ethernet size) the difference should > be larger. > > Note that this patch changes the semantics of __inet_lookup() and > __inet_lookup_established() to *not* perform a sock_hold(). This way > we can avoid the atomic inc and dec of the reference count and rely on > rcu pinning the socket over the scope of the rcu_read_lock_bh() region.
RCU introduces noticeble latencies for writing part compared to rwlock, so workloads when a lot of new short connections are created and destroyed, like busy web server within LAN with small latencies, will suffer from this, doesn't it? > Only minimal fixes for ipv6 and dccp to use the renamed wlock, as I am not > setup to test them. I have stared at this patch for a while, and I think > it's correct, but more eyes are definately warranted. Most of the issues > regarding the state and lifespan of a struct sock are already handled by > the network layer as the socket can be locked after being retrieved from > the connection hashtable, we just have to be careful about reinitializing > fields that the rcu hash list depends on. > > -ben -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html