1. 15 2月, 2018 5 次提交
  2. 14 2月, 2018 31 次提交
  3. 13 2月, 2018 4 次提交
    • D
      Merge branch 'Replacing-net_mutex-with-rw_semaphore' · 885842d8
      David S. Miller 提交于
      Kirill Tkhai says:
      
      ====================
      Replacing net_mutex with rw_semaphore
      
      this is the third version of the patchset introducing net_sem
      instead of net_mutex. The patchset adds net_sem in addition
      to net_mutex and allows pernet_operations to be "async". This
      flag means, the pernet_operations methods are safe to be
      executed with any other pernet_operations (un)initializing
      another net.
      
      If there are only async pernet_operations in the system,
      net_mutex is not used either for setup_net() or for cleanup_net().
      
      The pernet_operations converted in this patchset allow
      to create minimal .config to have network working, and
      the changes improve the performance like you may see
      below:
      
          %for i in {1..10000}; do unshare -n bash -c exit; done
      
          *before*
          real 1m40,377s
          user 0m9,672s
          sys 0m19,928s
      
          *after*
          real 0m17,007s
          user 0m5,311s
          sys 0m11,779
      
          (5.8 times faster)
      
      In the future, when all pernet_operations become async,
      we'll just remove this "async" field tree-wide.
      
      All the new logic is concentrated in patches [1-5/32].
      The rest of patches converts specific operations:
      review, rationale of they can be converted, and setting
      of async flag.
      
      Kirill
      
      v3: Improved patches descriptions. Added comment into [5/32].
      Added [32/32] converting netlink_tap_net_ops (new pernet operations
      introduced in 2018).
      
      v2: Single patch -> patchset with rationale of every conversion
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      885842d8
    • K
      net: Convert netlink_tap_net_ops · b86b47a3
      Kirill Tkhai 提交于
      These pernet_operations init just allocated net memory,
      and they obviously can be executed in parallel in any
      others.
      
      v3: New
      Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Acked-by: NAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b86b47a3
    • K
      net: Convert diag_net_ops · 59a51358
      Kirill Tkhai 提交于
      These pernet operations just create and destroy netlink
      socket. The socket is pernet and else operations don't
      touch it.
      Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Acked-by: NAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59a51358
    • K
      net: Convert default_device_ops · 2608e6b7
      Kirill Tkhai 提交于
      These pernet operations consist of exit() and exit_batch() methods.
      
      default_device_exit() moves not-local and virtual devices to init_net.
      There is nothing exciting, because this may happen in any time
      on a working system, and rtnl_lock() and synchronize_net() protect
      us from all cases of external dereference.
      
      The same for default_device_exit_batch(). Similar unregisteration
      may happen in any time on a system. Here several lists (like todo_list),
      which are accessed under rtnl_lock(). After rtnl_unlock() and
      netdev_run_todo() all the devices are flushed.
      Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Acked-by: NAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2608e6b7