1. 21 Sep, 2017 22 commits
  2. 20 Sep, 2017 14 commits
  3. 19 Sep, 2017 4 commits
    • David S. Miller's avatar
      Merge branch 'net-speedup-netns-create-delete-time' · 8ca712c3
      David S. Miller authored
      Eric Dumazet says:
      
      ====================
      net: speedup netns create/delete time
      
      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
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ca712c3
    • Eric Dumazet's avatar
      ipv4: speedup ipv6 tunnels dismantle · 64bc1781
      Eric Dumazet authored
      Implement exit_batch() method to dismantle more devices
      per round.
      
      (rtnl_lock() ...
       unregister_netdevice_many() ...
       rtnl_unlock())
      
      Tested:
      $ cat add_del_unshare.sh
      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 :
      $ time ./add_del_unshare.sh
      net_namespace        126    282   5504    1    2 : tunables    8    4    0 : slabdata    126    282      0
      
      real    1m38.965s
      user    0m0.688s
      sys     0m37.017s
      
      After patch:
      $ 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
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64bc1781
    • Eric Dumazet's avatar
      ipv6: speedup ipv6 tunnels dismantle · bb401cae
      Eric Dumazet authored
      Implement exit_batch() method to dismantle more devices
      per round.
      
      (rtnl_lock() ...
       unregister_netdevice_many() ...
       rtnl_unlock())
      
      Tested:
      $ cat add_del_unshare.sh
      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 :
      $ time ./add_del_unshare.sh
      net_namespace        110    267   5504    1    2 : tunables    8    4    0 : slabdata    110    267      0
      
      real    3m25.292s
      user    0m0.644s
      sys     0m40.153s
      
      After patch:
      
      $ time ./add_del_unshare.sh
      net_namespace        126    282   5504    1    2 : tunables    8    4    0 : slabdata    126    282      0
      
      real	1m38.965s
      user	0m0.688s
      sys	0m37.017s
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb401cae
    • Eric Dumazet's avatar
      tcp: batch tcp_net_metrics_exit · 789e6ddb
      Eric Dumazet authored
      When dealing with a list of dismantling netns, we can scan
      tcp_metrics once, saving cpu cycles.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      789e6ddb