Skip to content

Batch network namespace cleanup

Eric W. Biederman netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCHinclude/linux/notifier.h include/net/route.h net/core/dev.c +2 more+20 -296 replies
2/20net: Implement for_each_netdev_reverse.include/linux/netdevice.h+2 -00 replies
3/20net: Batch network namespace destruction.include/net/net_namespace.h net/core/net_namespace.c+59 -90 replies
4/20net: Automatically allocate per namespace data.include/net/net_namespace.h net/core/net_namespace.c+126 -900 replies
5/20net: Simplify loopback and improve batching.drivers/net/loopback.c+0 -80 replies
6/20net: Simplfy default_device_exit and improve batching.net/core/dev.c+6 -100 replies
7/20net: Simplify the bond drivers pernet operations.drivers/net/bonding/bond_main.c+9 -230 replies
8/20net: Simplify vlan pernet operations.net/8021q/vlan.c+7 -260 replies
9/20net: Simplify af_key pernet operations.net/key/af_key.c+6 -190 replies
10/20net: Simplify conntrack_proto_dccp pernet operations.net/netfilter/nf_conntrack_proto_dccp.c+8 -230 replies
11/20net: Simplify conntrack_proto_gre pernet operations.net/netfilter/nf_conntrack_proto_gre.c+6 -140 replies
12/20net: Simplify ppp_generic pernet operations.drivers/net/ppp_generic.c+7 -230 replies
13/20net: Simplify pppoe pernet operations.drivers/net/pppoe.c+8 -300 replies
14/20net: Simplify pppol2tp pernet operations.drivers/net/pppol2tp.c+7 -290 replies
15/20net: Simplify phonet pernet operations.net/phonet/pn_dev.c+6 -100 replies
16/20net: Simplify ip_gre pernet operations.net/ipv4/ip_gre.c+6 -180 replies
17/20net: Simplify ipip pernet operations.net/ipv4/ipip.c+6 -180 replies
18/20net: Simplify ip6_tunnel pernet operations.net/ipv6/ip6_tunnel.c+6 -190 replies
19/20net: Simplify ipip6 aka sit pernet operations.net/ipv6/sit.c+6 -190 replies
20/20net: remove [un]register_pernet_gen_... and update the docs.include/net/net_namespace.h include/net/netns/generic.h+5 -250 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/20] Batch network namespace cleanup

Recently Jamal and Daniel perform some experiments and found that large numbers of network namespace exiting simultaneously is very inefficient. 24+ minutes in some configurations. The cpu overhead was negligible but it results in long hold times of net_mutex, and memory being consumed a long time after the last user has gone away.

I looked into it and discovered that by batching network namespace cleanups I can reduce the time for 4k network namespaces exiting from 5-7 minutes in my configuration to 44 seconds.

This patch series is my set of changes to the network namespace core and associated cleanups to allow for network namespace batching.

Eric

 drivers/net/bonding/bond_main.c         |   32 +---
 drivers/net/loopback.c                  |    8 -
 drivers/net/ppp_generic.c               |   30 +---
 drivers/net/pppoe.c                     |   38 +----
 drivers/net/pppol2tp.c                  |   36 +----
 include/linux/netdevice.h               |    2 +
 include/linux/notifier.h                |    2 +-
 include/net/net_namespace.h             |    8 +-
 include/net/netns/generic.h             |    8 +-
 include/net/route.h                     |    1 +
 net/8021q/vlan.c                        |   33 +---
 net/core/dev.c                          |   52 ++-----
 net/core/net_namespace.c                |  254 +++++++++++++++++++------------
 net/ipv4/fib_frontend.c                 |    4 +-
 net/ipv4/ip_gre.c                       |   24 +---
 net/ipv4/ipip.c                         |   24 +---
 net/ipv4/route.c                        |    6 +
 net/ipv6/ip6_tunnel.c                   |   25 +---
 net/ipv6/sit.c                          |   25 +---
 net/key/af_key.c                        |   25 +---
 net/netfilter/nf_conntrack_proto_dccp.c |   31 +---
 net/netfilter/nf_conntrack_proto_gre.c  |   20 +--
 net/phonet/pn_dev.c                     |   16 +--
 23 files changed, 284 insertions(+), 420 deletions(-)

Eric W. Biederman (20):
net: NETDEV_UNREGISTER_PERNET -> NETDEV_UNREGISTER_BATCH
net: Implement for_each_netdev_reverse.
net: Batch network namespace destruction.
net: Automatically allocate per namespace data.
net: Simplify loopback and improve batching.
net: Simplfy default_device_exit and improve batching.
net: Simplify the bond drivers pernet operations.
net: Simplify vlan pernet operations.
net: Simplify af_key pernet operations.
net: Simplify conntrack_proto_dccp pernet operations.
net: Simplify conntrack_proto_gre pernet operations.
net: Simplify ppp_generic pernet operations.
net: Simplify pppoe pernet operations.
net: Simplify pppol2tp pernet operations.
net: Simplify phonet pernet operations.
net: Simplify ip_gre pernet operations.
net: Simplify ipip pernet operations.
net: Simplify ip6_tunnel pernet operations.
net: Simplify ipip6 aka sit pernet operations.
net: remove [un]register_pernet_gen_... and update the docs.