inetpeer: Optimize inet_getid()
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 12 Nov 2009 09:33:09 +0000 (09:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Nov 2009 04:46:58 +0000 (20:46 -0800)
commit2c1409a0a2b88585ec0c03f1de0aafa178c56313
treee9fc25badfb716e5368079535f548cc8e4b5576a
parent234b27c3fd58fc0e15c04dd0fbf4337fac9c2a06
inetpeer: Optimize inet_getid()

While investigating for network latencies, I found inet_getid() was a
contention point for some workloads, as inet_peer_idlock is shared
by all inet_getid() users regardless of peers.

One way to fix this is to make ip_id_count an atomic_t instead
of __u16, and use atomic_add_return().

In order to keep sizeof(struct inet_peer) = 64 on 64bit arches
tcp_ts_stamp is also converted to __u32 instead of "unsigned long".

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inetpeer.h
net/ipv4/inetpeer.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c