tcp/dccp: do not touch listener sk_refcnt under synflood
When a SYNFLOOD targets a non SO_REUSEPORT listener, multiple cpus contend on sk->sk_refcnt and sk->sk_wmem_alloc changes. By letting listeners use SOCK_RCU_FREE infrastructure, we can relax TCP_LISTEN lookup rules and avoid touching sk_refcnt Note that we still use SLAB_DESTROY_BY_RCU rules for other sockets, only listeners are impacted by this change. Peak performance under SYNFLOOD is increased by ~33% : On my test machine, I could process 3.2 Mpps instead of 2.4 Mpps Most consuming functions are now skb_set_owner_w() and sock_wfree() contending on sk->sk_wmem_alloc when cooking SYNACK and freeing them. Signed-off-by:Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/inet6_hashtables.h 8 additions, 4 deletionsinclude/net/inet6_hashtables.h
- include/net/inet_hashtables.h 24 additions, 16 deletionsinclude/net/inet_hashtables.h
- net/dccp/ipv4.c 5 additions, 2 deletionsnet/dccp/ipv4.c
- net/dccp/ipv6.c 5 additions, 2 deletionsnet/dccp/ipv6.c
- net/ipv4/inet_diag.c 1 addition, 2 deletionsnet/ipv4/inet_diag.c
- net/ipv4/inet_hashtables.c 25 additions, 48 deletionsnet/ipv4/inet_hashtables.c
- net/ipv4/tcp_ipv4.c 33 additions, 33 deletionsnet/ipv4/tcp_ipv4.c
- net/ipv6/inet6_hashtables.c 15 additions, 41 deletionsnet/ipv6/inet6_hashtables.c
- net/ipv6/tcp_ipv6.c 15 additions, 12 deletionsnet/ipv6/tcp_ipv6.c
- net/netfilter/xt_socket.c 3 additions, 3 deletionsnet/netfilter/xt_socket.c
Loading
Please register or sign in to comment