tcp/dccp: get rid of central timewait timer
Using a timer wheel for timewait sockets was nice ~15 years ago when memory was expensive and machines had a single processor. This does not scale, code is ugly and source of huge latencies (Typically 30 ms have been seen, cpus spinning on death_lock spinlock.) We can afford to use an extra 64 bytes per timewait sock and spread timewait load to all cpus to have better behavior. Tested: On following test, /proc/sys/net/ipv4/tcp_tw_recycle is set to 1 on the target (lpaa24) Before patch : lpaa23:~# ./super_netperf 200 -H lpaa24 -t TCP_CC -l 60 -- -p0,0 419594 lpaa23:~# ./super_netperf 200 -H lpaa24 -t TCP_CC -l 60 -- -p0,0 437171 While test is running, we can observe 25 or even 33 ms latencies. lpaa24:~# ping -c 1000 -i 0.02 -qn lpaa23 ... 1000 packets transmitted, 1000 received, 0% packet loss, time 20601ms rtt min/avg/max/mdev = 0.020/0.217/25.771/1.535 ms, pipe 2 lpaa24:~# ping -c 1000 -i 0.02 -qn lpaa23 ... 1000 packets transmitted, 1000 received, 0% packet loss, time 20702ms rtt min/avg/max/mdev = 0.019/0.183/33.761/1.441 ms, pipe 2 After patch : About 90% increase of throughput : lpaa23:~# ./super_netperf 200 -H lpaa24 -t TCP_CC -l 60 -- -p0,0 810442 lpaa23:~# ./super_netperf 200 -H lpaa24 -t TCP_CC -l 60 -- -p0,0 800992 And latencies are kept to minimal values during this load, even if network utilization is 90% higher : lpaa24:~# ping -c 1000 -i 0.02 -qn lpaa23 ... 1000 packets transmitted, 1000 received, 0% packet loss, time 19991ms rtt min/avg/max/mdev = 0.023/0.064/0.360/0.042 ms Signed-off-by:Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/inet_timewait_sock.h 9 additions, 98 deletionsinclude/net/inet_timewait_sock.h
- net/dccp/minisocks.c 3 additions, 16 deletionsnet/dccp/minisocks.c
- net/ipv4/inet_diag.c 2 additions, 2 deletionsnet/ipv4/inet_diag.c
- net/ipv4/inet_hashtables.c 2 additions, 2 deletionsnet/ipv4/inet_hashtables.c
- net/ipv4/inet_timewait_sock.c 36 additions, 234 deletionsnet/ipv4/inet_timewait_sock.c
- net/ipv4/proc.c 1 addition, 1 deletionnet/ipv4/proc.c
- net/ipv4/tcp_ipv4.c 2 additions, 2 deletionsnet/ipv4/tcp_ipv4.c
- net/ipv4/tcp_minisocks.c 9 additions, 26 deletionsnet/ipv4/tcp_minisocks.c
- net/ipv6/inet6_hashtables.c 1 addition, 1 deletionnet/ipv6/inet6_hashtables.c
- net/ipv6/tcp_ipv6.c 2 additions, 2 deletionsnet/ipv6/tcp_ipv6.c
- net/netfilter/xt_TPROXY.c 2 additions, 2 deletionsnet/netfilter/xt_TPROXY.c
Loading
Please register or sign in to comment