All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/31] Replacing net_mutex with rw_semaphore
@ 2017-11-20 18:32 Kirill Tkhai
  2017-11-20 18:32 ` [PATCH v2 01/31] net: Assign net to net_namespace_list in setup_net() Kirill Tkhai
                   ` (32 more replies)
  0 siblings, 33 replies; 41+ messages in thread
From: Kirill Tkhai @ 2017-11-20 18:32 UTC (permalink / raw)
  To: davem, vyasevic, kstewart, pombredanne, vyasevich, mark.rutland,
	gregkh, adobriyan, fw, nicolas.dichtel, xiyou.wangcong,
	roman.kapl, paul, dsahern, daniel, lucien.xin, mschiffer,
	rshearma, linux-kernel, netdev, ktkhai, ebiederm, avagin,
	gorcunov, eric.dumazet, stephen, ktkhai

Hi,

there is the second version of 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 othor 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 flag is little easier, then (un)register_pernet_sys(),
as it changes one line only. Also, it requires less changes
in code. In future, when all pernet_operations are async,
we'll just remove this struct field.

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)
---

Kirill Tkhai (31):
      net: Assign net to net_namespace_list in setup_net()
      net: Cleanup copy_net_ns()
      net: Introduce net_sem for protection of pernet_list
      net: Move mutex_unlock() in cleanup_net() up
      net: Allow pernet_operations to be executed in parallel
      net: Convert proc_net_ns_ops
      net: Convert net_ns_ops methods
      net: Convert sysctl_pernet_ops
      net: Convert netfilter_net_ops
      net: Convert nf_log_net_ops
      net: Convert net_inuse_ops
      net: Convert net_defaults_ops
      net: Convert netlink_net_ops
      net: Convert rtnetlink_net_ops
      net: Convert audit_net_ops
      net: Convert uevent_net_ops
      net: Convert proto_net_ops
      net: Convert pernet_subsys ops, registered via net_dev_init()
      net: Convert fib_* pernet_operations, registered via subsys_initcall
      net: Convert subsys_initcall() registered pernet_operations from net/sched
      net: Convert genl_pernet_ops
      net: Convert wext_pernet_ops
      net: Convert sysctl_core_ops
      net: Convert pernet_subsys, registered from inet_init()
      net: Convert unix_net_ops
      net: Convert packet_net_ops
      net: Convert ipv4_sysctl_ops
      net: Convert addrconf_ops
      net: Convert loopback_net_ops
      net: Convert default_device_ops
      net: Convert diag_net_ops


 drivers/net/loopback.c      |    1 
 fs/proc/proc_net.c          |    1 
 include/linux/rtnetlink.h   |    1 
 include/net/net_namespace.h |    6 +++
 kernel/audit.c              |    1 
 lib/kobject_uevent.c        |    1 
 net/core/dev.c              |    2 +
 net/core/fib_notifier.c     |    1 
 net/core/fib_rules.c        |    1 
 net/core/net-procfs.c       |    2 +
 net/core/net_namespace.c    |   94 +++++++++++++++++++++++++------------------
 net/core/rtnetlink.c        |    5 +-
 net/core/sock.c             |    2 +
 net/core/sock_diag.c        |    1 
 net/core/sysctl_net_core.c  |    1 
 net/ipv4/af_inet.c          |    2 +
 net/ipv4/arp.c              |    1 
 net/ipv4/devinet.c          |    1 
 net/ipv4/fib_frontend.c     |    1 
 net/ipv4/icmp.c             |    1 
 net/ipv4/igmp.c             |    1 
 net/ipv4/ip_fragment.c      |    1 
 net/ipv4/ipmr.c             |    1 
 net/ipv4/ping.c             |    1 
 net/ipv4/proc.c             |    1 
 net/ipv4/raw.c              |    1 
 net/ipv4/route.c            |    4 ++
 net/ipv4/sysctl_net_ipv4.c  |    1 
 net/ipv4/tcp_ipv4.c         |    2 +
 net/ipv4/tcp_metrics.c      |    1 
 net/ipv4/udp.c              |    1 
 net/ipv4/udplite.c          |    1 
 net/ipv4/xfrm4_policy.c     |    1 
 net/ipv6/addrconf.c         |    1 
 net/netfilter/core.c        |    1 
 net/netfilter/nf_log.c      |    1 
 net/netlink/af_netlink.c    |    1 
 net/netlink/genetlink.c     |    1 
 net/packet/af_packet.c      |    1 
 net/sched/act_api.c         |    1 
 net/sched/sch_api.c         |    1 
 net/sysctl_net.c            |    1 
 net/unix/af_unix.c          |    1 
 net/wireless/wext-core.c    |    1 
 net/xfrm/xfrm_policy.c      |    1 
 45 files changed, 114 insertions(+), 41 deletions(-)

--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

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

end of thread, other threads:[~2018-01-19  8:25 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 18:32 [PATCH v2 00/31] Replacing net_mutex with rw_semaphore Kirill Tkhai
2017-11-20 18:32 ` [PATCH v2 01/31] net: Assign net to net_namespace_list in setup_net() Kirill Tkhai
2017-11-20 18:32 ` [PATCH v2 02/31] net: Cleanup copy_net_ns() Kirill Tkhai
2017-11-20 18:32 ` [PATCH v2 03/31] net: Introduce net_sem for protection of pernet_list Kirill Tkhai
2018-01-17 20:04   ` Andrei Vagin
2018-01-18 10:14     ` Kirill Tkhai
2017-11-20 18:32 ` [PATCH v2 04/31] net: Move mutex_unlock() in cleanup_net() up Kirill Tkhai
2017-11-20 18:32 ` [PATCH v2 05/31] net: Allow pernet_operations to be executed in parallel Kirill Tkhai
2018-01-17 18:34   ` Andrei Vagin
2018-01-18 10:16     ` Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 06/31] net: Convert proc_net_ns_ops Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 07/31] net: Convert net_ns_ops methods Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 08/31] net: Convert sysctl_pernet_ops Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 09/31] net: Convert netfilter_net_ops Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 10/31] net: Convert nf_log_net_ops Kirill Tkhai
2017-11-20 18:33 ` [PATCH v2 11/31] net: Convert net_inuse_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 12/31] net: Convert net_defaults_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 13/31] net: Convert netlink_net_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 14/31] net: Convert rtnetlink_net_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 15/31] net: Convert audit_net_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 16/31] net: Convert uevent_net_ops Kirill Tkhai
2017-11-20 18:34 ` [PATCH v2 17/31] net: Convert proto_net_ops Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 18/31] net: Convert pernet_subsys ops, registered via net_dev_init() Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 19/31] net: Convert fib_* pernet_operations, registered via subsys_initcall Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 20/31] net: Convert subsys_initcall() registered pernet_operations from net/sched Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 21/31] net: Convert genl_pernet_ops Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 22/31] net: Convert wext_pernet_ops Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 23/31] net: Convert sysctl_core_ops Kirill Tkhai
2017-11-20 18:35 ` [PATCH v2 24/31] net: Convert pernet_subsys, registered from inet_init() Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 25/31] net: Convert unix_net_ops Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 26/31] net: Convert packet_net_ops Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 27/31] net: Convert ipv4_sysctl_ops Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 28/31] net: Convert addrconf_ops Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 29/31] net: Convert loopback_net_ops Kirill Tkhai
2017-11-20 18:36 ` [PATCH v2 30/31] net: Convert default_device_ops Kirill Tkhai
2017-11-20 18:37 ` [PATCH v2 31/31] net: Convert diag_net_ops Kirill Tkhai
2017-12-04 15:54 ` [PATCH v2 00/31] Replacing net_mutex with rw_semaphore Kirill Tkhai
2017-12-04 16:10   ` David Miller
2017-12-04 16:11     ` Kirill Tkhai
2018-01-18 17:43 ` Andrei Vagin
2018-01-19  8:25   ` Kirill Tkhai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.