netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/7] net: speedup netns create/delete time
@ 2017-09-19 23:27 Eric Dumazet
  2017-09-19 23:27 ` [PATCH v2 net-next 1/7] kobject: add kobject_uevent_net_broadcast() Eric Dumazet
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Eric Dumazet @ 2017-09-19 23:27 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Eric W . Biederman, Eric Dumazet, Eric Dumazet

When rate of netns creation/deletion is high enough,
we observe softlockups in cleanup_net() caused by huge list
of netns and way too many rcu_barrier() calls.

This patch series does some optimizations in kobject,
and add batching to tunnels so that netns dismantles are
less costly.

IPv6 addrlabels also get a per netns list, and tcp_metrics
also benefit from batch flushing.

This gives me one order of magnitude gain.
(~50 ms -> ~5 ms for one netns create/delete pair)

Tested:

for i in `seq 1 40`
do
 (for j in `seq 1 100` ; do  unshare -n /bin/true >/dev/null ; done) &
done
wait ; grep net_namespace /proc/slabinfo

Before patch series :

$ time ./add_del_unshare.sh
net_namespace        116    258   5504    1    2 : tunables    8    4    0 : slabdata    116    258      0

real	3m24.910s
user	0m0.747s
sys	0m43.162s

After :
$ time ./add_del_unshare.sh
net_namespace        135    291   5504    1    2 : tunables    8    4    0 : slabdata    135    291      0

real	0m22.117s
user	0m0.728s
sys	0m35.328s


Eric Dumazet (7):
  kobject: add kobject_uevent_net_broadcast()
  kobject: copy env blob in one go
  kobject: factorize skb setup in kobject_uevent_net_broadcast()
  ipv6: addrlabel: per netns list
  tcp: batch tcp_net_metrics_exit
  ipv6: speedup ipv6 tunnels dismantle
  ipv4: speedup ipv6 tunnels dismantle

 include/net/ip_tunnels.h |  3 +-
 include/net/netns/ipv6.h |  5 +++
 lib/kobject_uevent.c     | 94 ++++++++++++++++++++++++++----------------------
 net/ipv4/ip_gre.c        | 22 +++++-------
 net/ipv4/ip_tunnel.c     | 12 +++++--
 net/ipv4/ip_vti.c        |  7 ++--
 net/ipv4/ipip.c          |  7 ++--
 net/ipv4/tcp_metrics.c   | 14 +++++---
 net/ipv6/addrlabel.c     | 81 ++++++++++++++++-------------------------
 net/ipv6/ip6_gre.c       |  8 +++--
 net/ipv6/ip6_tunnel.c    | 20 ++++++-----
 net/ipv6/ip6_vti.c       | 23 +++++++-----
 net/ipv6/sit.c           |  9 +++--
 13 files changed, 157 insertions(+), 148 deletions(-)

-- 
2.14.1.690.gbb1197296e-goog

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-12-13 22:24 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 23:27 [PATCH v2 net-next 0/7] net: speedup netns create/delete time Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 1/7] kobject: add kobject_uevent_net_broadcast() Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 2/7] kobject: copy env blob in one go Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 3/7] kobject: factorize skb setup in kobject_uevent_net_broadcast() Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 4/7] ipv6: addrlabel: per netns list Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 5/7] tcp: batch tcp_net_metrics_exit Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 6/7] ipv6: speedup ipv6 tunnels dismantle Eric Dumazet
2017-09-19 23:27 ` [PATCH v2 net-next 7/7] ipv4: " Eric Dumazet
2017-09-19 23:32 ` [PATCH v2 net-next 0/7] net: speedup netns create/delete time David Miller
2017-09-26 11:21 ` Tariq Toukan
2017-09-26 12:51   ` Eric Dumazet
2017-09-26 15:04     ` Tariq Toukan
2017-09-26 15:13       ` Eric Dumazet
2017-09-26 15:22         ` Dmitry Torokhov
2017-09-26 15:30           ` Eric Dumazet
2017-10-19 11:48             ` Tariq Toukan
2017-10-19 14:11               ` Eric Dumazet
2017-12-13 21:43                 ` Dmitry Torokhov
2017-12-13 21:52                   ` Eric Dumazet
2017-12-13 22:24                     ` Dmitry Torokhov
2017-09-26 15:26         ` Tariq Toukan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).