Skip to content

tcp/dccp: lockless listener

Eric Dumazet netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17tcp: add a spinlock to protect struct request_sock_queueinclude/net/request_sock.h net/core/request_sock.c net/ipv4/inet_connection_sock.c+26 -330 replies
2/17tcp: move qlen/young out of struct listen_sockinclude/net/request_sock.h net/core/request_sock.c net/ipv4/inet_connection_sock.c +1 more+18 -380 replies
3/17tcp: move synflood_warned into struct request_sock_queueinclude/net/request_sock.h net/ipv4/tcp_input.c+4 -50 replies
4/17tcp: call sk_mark_napi_id() on the child, not the listenernet/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+2 -20 replies
5/17tcp/dccp: init sk_prot and call sk_node_init() in reqsk_alloc()include/net/request_sock.h+12 -100 replies
6/17tcp: cleanup tcp_v[46]_inbound_md5_hash()net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+12 -140 replies
7/17tcp: remove BUG_ON() in tcp_check_req()net/ipv4/tcp_minisocks.c+0 -20 replies
8/17tcp: get_openreq[46]() changesinclude/net/tcp.h net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+8 -80 replies
9/17tcp/dccp: remove inet_csk_reqsk_queue_added() timeout argumentinclude/net/inet_connection_sock.h net/ipv4/inet_connection_sock.c net/ipv6/inet6_connection_sock.c+3 -40 replies
10/17tcp/dccp: install syn_recv requests into ehash tableinclude/net/inet_connection_sock.h include/net/inet_hashtables.h include/net/request_sock.h +12 more+160 -5010 replies
11/17tcp/dccp: shrink struct listen_sockinclude/net/request_sock.h net/core/request_sock.c+3 -140 replies
12/17ipv6: remove obsolete inet6 functionsinclude/net/inet6_connection_sock.h+0 -90 replies
13/17tcp: attach SYNACK messages to request sockets instead of listenerinclude/net/tcp.h net/ipv4/inet_connection_sock.c net/ipv4/tcp_fastopen.c +5 more+47 -320 replies
14/17tcp/dccp: remove struct listen_sockinclude/net/request_sock.h net/core/request_sock.c net/ipv4/inet_connection_sock.c+11 -760 replies
15/17tcp: remove max_qlen_loginclude/net/inet_connection_sock.h include/net/request_sock.h net/core/request_sock.c +1 more+6 -180 replies
16/17tcp/dccp: add a reschedule point in inet_csk_listen_stop()net/ipv4/inet_connection_sock.c+1 -00 replies
17/17tcp: do not lock listener to process SYN packetsnet/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+18 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 00/17] tcp/dccp: lockless listener

TCP listener refactoring : this is becoming interesting !

This patch series takes the steps to use normal TCP/DCCP ehash table to store SYN_RECV requests, instead of the private per-listener hash table we had until now.

SYNACK skb are now attached to their syn_recv request socket, so that we no longer heavily modify listener sk_wmem_alloc.

listener lock is no longer held in fast path, including SYNCOOKIE mode.

During my tests, my server was able to process 3,500,000 SYN packets per second on one listener and still had available cpu cycles.

That is about 2 to 3 order of magnitude what we had with older kernels.

This effort started two years ago and I am pleased to reach expectations.

We'll probably extend SO_REUSEPORT to add proper cpu/numa affinities, so that heavy duty TCP servers can get proper siloing thanks to multi-queues NIC.

Eric Dumazet (17):
tcp: add a spinlock to protect struct request_sock_queue
tcp: move qlen/young out of struct listen_sock
tcp: move synflood_warned into struct request_sock_queue
tcp: call sk_mark_napi_id() on the child, not the listener tcp/dccp: init sk_prot and call sk_node_init() in reqsk_alloc()
tcp: cleanup tcp_v[46]_inbound_md5_hash()
tcp: remove BUG_ON() in tcp_check_req()
tcp: get_openreq[46]() changes
tcp/dccp: remove inet_csk_reqsk_queue_added() timeout argument tcp/dccp: install syn_recv requests into ehash table tcp/dccp: shrink struct listen_sock
ipv6: remove obsolete inet6 functions
tcp: attach SYNACK messages to request sockets instead of listener tcp/dccp: remove struct listen_sock
tcp: remove max_qlen_log
tcp/dccp: add a reschedule point in inet_csk_listen_stop()
tcp: do not lock listener to process SYN packets

 include/net/inet6_connection_sock.h |   9 --
 include/net/inet_connection_sock.h  |   9 +-
 include/net/inet_hashtables.h       |   1 +
 include/net/request_sock.h          | 132 ++++++++++--------------------
 include/net/tcp.h                   |  10 +--
 net/core/request_sock.c             |  84 +------------------
 net/dccp/ipv4.c                     |  64 +++++----------
 net/dccp/ipv6.c                     |  72 +++++-----------
 net/ipv4/inet_connection_sock.c     | 145 ++++++++------------------------
 net/ipv4/inet_diag.c                |  96 ++--------------------
 net/ipv4/inet_hashtables.c          |  14 +++-
 net/ipv4/syncookies.c               |   4 +
 net/ipv4/tcp_fastopen.c             |   4 +-
 net/ipv4/tcp_input.c                |  30 +++----
 net/ipv4/tcp_ipv4.c                 | 159 +++++++++++++-----------------------
 net/ipv4/tcp_minisocks.c            |   2 -
 net/ipv4/tcp_output.c               |  22 +++--
 net/ipv6/inet6_connection_sock.c    |  67 ---------------
 net/ipv6/tcp_ipv6.c                 | 117 +++++++++++++-------------
 net/sched/sch_fq.c                  |  12 +--
 20 files changed, 307 insertions(+), 746 deletions(-)
Signature · 1 line
2.6.0.rc2.230.g3dd15c0