Skip to content

netns: speedup netns dismantles

Eric Dumazet lkml mptcp netdev oe-lkp 1 version Applied

Status from this message: Applied, thanks, 51d555cfdcc6 ("Merge branch

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6tcp/dccp: add tw->tw_bslotinclude/net/inet_timewait_sock.h net/ipv4/inet_timewait_sock.c+8 -40 replies
2/6tcp/dccp: no longer use twsk_net(tw) from tw_timer_handler()include/net/inet_timewait_sock.h net/ipv4/inet_timewait_sock.c+6 -80 replies
3/6tcp/dccp: get rid of inet_twsk_purge()include/net/inet_timewait_sock.h net/dccp/ipv4.c net/dccp/ipv6.c +3 more+0 -691 reply
4/6ipv4: do not use per netns icmp socketsinclude/net/netns/ipv4.h net/ipv4/icmp.c+31 -610 replies
5/6ipv6: do not use per netns icmp socketsinclude/net/netns/ipv6.h net/ipv6/icmp.c+10 -530 replies
6/6ipv4/tcp: do not use per netns ctl socketsinclude/net/netns/ipv4.h net/ipv4/tcp_ipv4.c+27 -354 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchPaolo Abeni
1/6
2/6
3/6T-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/6] netns: speedup netns dismantles

From: Eric Dumazet <[email protected]>

netns are dismantled by a single thread, from cleanup_net()

On hosts with many TCP sockets, and/or many cpus, this thread is spending too many cpu cycles, and can not keep up with some workloads.

- Removing 3*num_possible_cpus() sockets per netns, for icmp and tcp protocols.
- Iterating over all TCP sockets to remove stale timewait sockets.

This patch series removes ~50% of cleanup_net() cpu costs on hosts with 256 cpus. It also reduces per netns memory footprint.

Eric Dumazet (6):
tcp/dccp: add tw->tw_bslot
tcp/dccp: no longer use twsk_net(tw) from tw_timer_handler() tcp/dccp: get rid of inet_twsk_purge()
ipv4: do not use per netns icmp sockets
ipv6: do not use per netns icmp sockets
ipv4/tcp: do not use per netns ctl sockets

 include/net/inet_timewait_sock.h |  8 ++-
 include/net/netns/ipv4.h         |  2 -
 include/net/netns/ipv6.h         |  1 -
 net/dccp/ipv4.c                  |  6 ---
 net/dccp/ipv6.c                  |  6 ---
 net/ipv4/icmp.c                  | 91 +++++++++++---------------------
 net/ipv4/inet_timewait_sock.c    | 67 ++++-------------------
 net/ipv4/tcp_ipv4.c              | 63 ++++++++++------------
 net/ipv6/icmp.c                  | 62 ++++------------------
 net/ipv6/tcp_ipv6.c              |  6 ---
 10 files changed, 82 insertions(+), 230 deletions(-)
Signature · 1 line
2.35.0.rc0.227.g00780c9af4-goog