[PATCH net-next v2 1/5] net: Revert "ipv4: get rid of ip_ra_lock"

2018-03-19 Thread Kirill Tkhai
15e51edad1. ip_ra_lock will be used again. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/ip_sockglue.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 74c962b9b09c..be7c3b71914d 10064

[PATCH net-next v2 2/5] net: Revert "ipv4: fix a deadlock in ip_ra_control"

2018-03-19 Thread Kirill Tkhai
patches in series will rework this in another way, so now we revert 1215e51edad1. Also, it doesn't seen mrtsock_destruct() takes sk_lock, and the comment to the commit does not show the actual stack dump. So, there is a question did we really need in it. Signed-off-by: Kirill Tkhai <

[PATCH net-next v2 3/5] net: Move IP_ROUTER_ALERT out of lock_sock(sk)

2018-03-19 Thread Kirill Tkhai
ip_ra_control() does not need sk_lock. Who are the another users of ip_ra_chain? ip_mroute_setsockopt() doesn't take sk_lock, while parallel IP_ROUTER_ALERT syscalls are synchronized by ip_ra_lock. So, we may move this command out of sk_lock. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.

[PATCH net-next v2 0/5] Rework ip_ra_chain protection

2018-03-19 Thread Kirill Tkhai
warning (4/5), as reported by kbuild test robot. Kirill Tkhai (5): net: Revert "ipv4: get rid of ip_ra_lock" net: Revert "ipv4: fix a deadlock in ip_ra_control" net: Move IP_ROUTER_ALERT out of lock_sock(sk) net: Make ip_ra_chain per struct net net: Repl

Re: [rds-devel] [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-17 Thread Kirill Tkhai
On 18.03.2018 00:26, Sowmini Varadhan wrote: > On (03/17/18 10:15), Sowmini Varadhan wrote: >> To solve the scaling problem why not just have a well-defined >> callback to modules when devices are quiesced, instead of >> overloading the pernet_device registration in this obscure way? > > I

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-17 Thread Kirill Tkhai
On 17.03.2018 17:15, Sowmini Varadhan wrote: > > I spent a long time staring at both v1 and v2 of your patch. Thanks for your time! > I understand the overall goal, but I am afraid to say that these > patches are complete hacks. I'm not agree with you, see below the explanations. > I was

Re: [PATCH net-next 0/6] Converting pernet_operations (part #8)

2018-03-17 Thread Kirill Tkhai
On 18.03.2018 00:07, David Miller wrote: > From: Kirill Tkhai <ktk...@virtuozzo.com> > Date: Thu, 15 Mar 2018 12:10:47 +0300 > >> this series continues to review and to convert pernet_operations >> to make them possible to be executed in parallel for several >>

Re: [PATCH net-next 4/5] net: Make ip_ra_chain per struct net

2018-03-17 Thread Kirill Tkhai
us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Kirill-Tkhai/Rework-ip_ra_chain-protection/20180317-032841 > reproduce: > # apt-get install sparse > make ARCH=x86_64 allmodconfig > make C=1 CF=-D__CHEC

Re: [PATCH v2] netns: send uevent messages

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 15:50, Christian Brauner wrote: > This patch adds a receive method to NETLINK_KOBJECT_UEVENT netlink sockets > to allow sending uevent messages into the network namespace the socket > belongs to. > > Currently non-initial network namespaces are already isolated and don't > receive

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 21:31, Sowmini Varadhan wrote: > On (03/16/18 21:14), Kirill Tkhai wrote: >> >> I did the second version and sent you. Have you tried it? > > I tried it briefly, and it works for the handful of testcases > that I tried, but I still think its very werid to reg

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
ly. If you implement a network device and it > * needs per network namespace operations use device pernet operations, > * otherwise use pernet subsys operations. This is not a strict rule, and currently I'm working on pernet_operations synchronization. This commentary is for generic code,

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 17:36, Kirill Tkhai wrote: > On 16.03.2018 16:53, Sowmini Varadhan wrote: >> >> Found my previous question: >> >> https://www.mail-archive.com/netdev@vger.kernel.org/msg72330.html >> >> (see section about "Comments ar

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 16:53, Sowmini Varadhan wrote: > > Found my previous question: > > https://www.mail-archive.com/netdev@vger.kernel.org/msg72330.html > > (see section about "Comments are specifically ivinted.." I see, thanks. >> This is not a problem, and rds-tcp is not the only pernet_subsys

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 16:00, Sowmini Varadhan wrote: > On (03/16/18 15:38), Kirill Tkhai wrote: >> >> 467fa15356acf by Sowmini Varadhan added NETDEV_UNREGISTER_FINAL dependence >> with the commentary: >> >> /* rds-tcp registers as a pernet subys, so the ->exit wi

[PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
Hi, rds_tcp_dev_event() is the last user of NETDEV_UNREGISTER_FINAL stage. If we rework it, we'll be able to kill the stage, and this will decrease the number of rtnl_lock() we take during generic net device unregistration. This is very hot path for namespaces. 467fa15356acf by Sowmini Varadhan

Re: [BUG/Q] can_pernet_exit() leaves devices on dead net

2018-03-16 Thread Kirill Tkhai
On 06.03.2018 13:26, Oliver Hartkopp wrote: > - DaveM > > Hi Kirill, > > On 03/05/2018 04:22 PM, Kirill Tkhai wrote: > >> Thanks for the explanation, and module unloading should be nice. Just to >> clarify, >> I worry not about rules, but about netdevice

Re: netns: send uevent messages

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 02:46, Christian Brauner wrote: > On Thu, Mar 15, 2018 at 05:14:13PM +0300, Kirill Tkhai wrote: >> On 15.03.2018 16:39, Christian Brauner wrote: >>> On Thu, Mar 15, 2018 at 12:47:30PM +0300, Kirill Tkhai wrote: >>>> CC Andrey Vagin >>> >>

Re: [PATCH net-next nfs 0/6] Converting pernet_operations (part #7)

2018-03-15 Thread Kirill Tkhai
On 15.03.2018 17:24, J. Bruce Fields wrote: > On Thu, Mar 15, 2018 at 04:32:30PM +0300, Kirill Tkhai wrote: >> Trond, Anna, Bruce, Jeff, David and other NFS and RXRPC people, >> could you please provide your vision on this patches? > > Whoops, sorry, I haven't been paying at

Re: netns: send uevent messages

2018-03-15 Thread Kirill Tkhai
On 15.03.2018 16:39, Christian Brauner wrote: > On Thu, Mar 15, 2018 at 12:47:30PM +0300, Kirill Tkhai wrote: >> CC Andrey Vagin > > Hey Kirill, > > Thanks for CCing Andrey. > >> >> On 15.03.2018 03:12, Christian Brauner wrote: >>> This patch ad

Re: [PATCH net-next nfs 0/6] Converting pernet_operations (part #7)

2018-03-15 Thread Kirill Tkhai
Hi, Trond, Anna, Bruce, Jeff, David and other NFS and RXRPC people, could you please provide your vision on this patches? Thanks, Kirill On 13.03.2018 13:49, Kirill Tkhai wrote: > Hi, > > this series continues to review and to convert pernet_operations > to make them possible to

[PATCH net-next 1/5] net: Revert "ipv4: get rid of ip_ra_lock"

2018-03-15 Thread Kirill Tkhai
15e51edad1. ip_ra_lock will be used again. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/ip_sockglue.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 74c962b9b09c..be7c3b71914d 10064

[PATCH net-next 0/5] Rework ip_ra_chain protection

2018-03-15 Thread Kirill Tkhai
does we need it at all. This patchset reworks the locking: reverts the problem commit and its descendant, and introduces rtnl-independent locking. This may have a continuation, and someone may work on killing rtnl_lock() in mrtsock_destruct() in the future. Thanks, Kirill --- Kirill Tkhai (

[PATCH net-next 3/5] net: Move IP_ROUTER_ALERT out of lock_sock(sk)

2018-03-15 Thread Kirill Tkhai
ip_ra_control() does not need sk_lock. Who are the another users of ip_ra_chain? ip_mroute_setsockopt() doesn't take sk_lock, while parallel IP_ROUTER_ALERT syscalls are synchronized by ip_ra_lock. So, we may move this command out of sk_lock. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.

[PATCH net-next 5/5] net: Replace ip_ra_lock with per-net mutex

2018-03-15 Thread Kirill Tkhai
Since ra_chain is per-net, we may use per-net mutexes to protect them in ip_ra_control(). This improves scalability. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- include/net/netns/ipv4.h |1 + net/core/net_namespace.c |1 + net/ipv4/ip_sockglue.c | 15 ++--

[PATCH net-next 4/5] net: Make ip_ra_chain per struct net

2018-03-15 Thread Kirill Tkhai
This is optimization, which makes ip_call_ra_chain() iterate less sockets to find the sockets it's looking for. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- include/net/ip.h | 13 +++-- include/net/netns/ipv4.h |1 + net/ipv4/ip_input.c |5 ++--- ne

[PATCH net-next 2/5] net: Revert "ipv4: fix a deadlock in ip_ra_control"

2018-03-15 Thread Kirill Tkhai
patches in series will rework this in another way, so now we revert 1215e51edad1. Also, it doesn't seen mrtsock_destruct() takes sk_lock, and the comment to the commit does not show the actual stack dump. So, there is a question did we really need in it. Signed-off-by: Kirill Tkhai <

Re: netns: send uevent messages

2018-03-15 Thread Kirill Tkhai
CC Andrey Vagin On 15.03.2018 03:12, Christian Brauner wrote: > This patch adds a receive method to NETLINK_KOBJECT_UEVENT netlink sockets > to allow sending uevent messages into the network namespace the socket > belongs to. > > Currently non-initial network namespaces are already isolated and

[PATCH net-next 6/6] net: Convert ip_vs_ftp_ops

2018-03-15 Thread Kirill Tkhai
These pernet_operations register and unregister ipvs app. register_ip_vs_app(), unregister_ip_vs_app() and register_ip_vs_app_inc() modify per-net structures, and there are no global structures touched. So, this looks safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.

[PATCH net-next 5/6] net: Convert ipvs_core_dev_ops

2018-03-15 Thread Kirill Tkhai
Exit method stops two per-net threads and cancels delayed work. Everything looks nicely per-net divided. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/ipvs/ip_vs_core.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/net

[PATCH net-next 2/6] net: Convert mpls_net_ops

2018-03-15 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl table. Exit methods frees platform_labels from net::mpls::platform_label. Everything is per-net, and they looks safe to be marked async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/mpls/af_mpls.c |1 + 1 file chan

[PATCH net-next 4/6] net: Convert ipvs_core_ops

2018-03-15 Thread Kirill Tkhai
there were possible several timer expirations before this patch, and since they are safe, the patch does not invent new parallelism of their destruction. These pernet_operations look safe to be converted. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/ipvs/ip_vs_core.c |

[PATCH net-next 1/6] net: Convert l2tp_net_ops

2018-03-15 Thread Kirill Tkhai
Init method is rather simple. Exit method queues del_work for every tunnel from per-net list. This seems to be safe to be marked async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/l2tp/l2tp_core.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/l2tp/l2tp_core.c

[PATCH net-next 0/6] Converting pernet_operations (part #8)

2018-03-15 Thread Kirill Tkhai
Hi, this series continues to review and to convert pernet_operations to make them possible to be executed in parallel for several net namespaces at the same time. There are different operations over the tree, mostly are ipvs. Thanks, Kirill --- Kirill Tkhai (6): net: Convert l2tp_net_ops

[PATCH net-next 3/6] net: Convert ovs_net_ops

2018-03-15 Thread Kirill Tkhai
to be executed in parallel. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/openvswitch/datapath.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index ef38e5aecd28..100191df0371 100644 --- a/net/openvswitch/datapath.c

[PATCH net-next 2/2] net: Use rtnl_lock_killable() in register_netdev()

2018-03-14 Thread Kirill Tkhai
This patch adds rtnl_lock_killable() to one of hot path using rtnl_lock(). Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/core/dev.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 12a9aad0b057..d8887cc38e7b

[PATCH net-next 0/2] Introduce rtnl_lock_killable()

2018-03-14 Thread Kirill Tkhai
primitive, which responds on SIGKILL, and it allows to use it in the places, where we don't want to sleep forever. Also, the first place is made to use it. --- Kirill Tkhai (2): net: Add rtnl_lock_killable() net: Use rtnl_lock_killable() in register_netdev() include/linux/rtnetlink.h

[PATCH net-next 1/2] net: Add rtnl_lock_killable()

2018-03-14 Thread Kirill Tkhai
primitive, which responds on SIGKILL, and it allows to use it in the places, where we don't want to sleep forever. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- include/linux/rtnetlink.h |1 + net/core/rtnetlink.c |6 ++ 2 files changed, 7 insertions(+) diff --git a/i

[PATCH net-next] net: Add comment about pernet_operations methods and synchronization

2018-03-13 Thread Kirill Tkhai
Make locking scheme be visible for users, and provide a comment what for we are need exit_batch() methods, and when it should be used. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- include/net/net_namespace.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/i

[PATCH net-next nfs 6/6] net: Convert rxrpc_net_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations modifies rxrpc_net_id-pointed per-net entities. There is external link to AF_RXRPC in fs/afs/Kconfig, but it seems there is no other pernet_operations interested in that per-net entities. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/rxrpc/net_ns.c

[PATCH net-next nfs 5/6] net: Convert nfs4blocklayout_net_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations create and destroy per-net pipe and dentry, and they seem safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- fs/nfs/blocklayout/rpc_pipefs.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/blocklayout/rpc_pipefs.c b/

[PATCH net-next nfs 2/6] net: Convert sunrpc_net_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another caches. So, they also can be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/sunrpc/sunrpc_syms.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/sunrpc_sy

[PATCH net-next nfs 3/6] net: Convert nfsd_net_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another caches. So, they also can be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- fs/nfsd/nfsctl.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nf

[PATCH net-next nfs 4/6] net: Convert nfs4_dns_resolver_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another cache. Also they create and destroy directory. So, they also look safe to be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- fs/nfs/dns_resolve.c |1 + 1 file changed, 1 ins

[PATCH net-next nfs 1/6] net: Convert rpcsec_gss_net_ops

2018-03-13 Thread Kirill Tkhai
be callers in parallel, so we won't miss list_empty() in this case. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/sunrpc/auth_gss/auth_gss.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 9463af

[PATCH net-next nfs 0/6] Converting pernet_operations (part #7)

2018-03-13 Thread Kirill Tkhai
exceptions. Also, there is rxrpc_net_ops, which is used in AFS. Thanks, Kirill --- Kirill Tkhai (6): net: Convert rpcsec_gss_net_ops net: Convert sunrpc_net_ops net: Convert nfsd_net_ops net: Convert nfs4_dns_resolver_ops net: Convert nfs4blocklayout_net_ops

[PATCH net-next 4/4] net: Convert rds_tcp_net_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations create and destroy sysctl table and listen socket. Also, exit method flushes global workqueue and work. Everything looks per-net safe, so we can mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/rds/tcp.c |1 + 1 file changed, 1 ins

[PATCH net-next 3/4] net: Convert tipc_net_ops

2018-03-13 Thread Kirill Tkhai
TIPC looks concentrated in itself, and other pernet_operations seem not touching its entities. tipc_net_ops look pernet-divided, and they should be safe to be executed in parallel for several net the same time. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/tipc/core.c |

[PATCH net-next 1/4] net: Convert sctp_defaults_ops

2018-03-13 Thread Kirill Tkhai
to be executed in parallel. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/sctp/protocol.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 91813e686c67..32be52304f98 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/prot

[PATCH net-next 2/4] net: Convert sctp_ctrlsock_ops

2018-03-13 Thread Kirill Tkhai
These pernet_operations create and destroy net::sctp::ctl_sock. Since pernet_operations do not send sctp packets each other, they look safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/sctp/protocol.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net-next 0/4] Converting pernet_operations (part #6)

2018-03-13 Thread Kirill Tkhai
Hi, this series continues to review and to convert pernet_operations to make them possible to be executed in parallel for several net namespaces in the same time. There are sctp, tipc and rds in this series. Thanks, Kirill --- Kirill Tkhai (4): net: Convert sctp_defaults_ops net

Re: [PATCH net-next] ip6mr: remove synchronize_rcu() in favor of SOCK_RCU_FREE

2018-03-07 Thread Kirill Tkhai
Tested: > time for i in {1..1000}; do unshare -n /bin/false;done > > Before : real 7m18.911s > After : real 10.187s > > Fixes: 8571ab479a6e ("ip6mr: Make mroute_sk rcu-based") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Reported-by: Kirill Tkhai

Re: [PATCH v3 net-next 2/5] net/ipv6: Address checks need to consider the L3 domain

2018-03-07 Thread Kirill Tkhai
On 07.03.2018 14:53, Kirill Tkhai wrote: > On 07.03.2018 06:58, David Ahern wrote: >> ipv6_chk_addr_and_flags determines if an address is a local address. It >> is called by ip6_route_info_create to validate a gateway address is not a >> local address. It currently does no

Re: [PATCH v3 net-next 2/5] net/ipv6: Address checks need to consider the L3 domain

2018-03-07 Thread Kirill Tkhai
On 07.03.2018 06:58, David Ahern wrote: > ipv6_chk_addr_and_flags determines if an address is a local address. It > is called by ip6_route_info_create to validate a gateway address is not a > local address. It currently does not consider L3 domains and as a result > does not allow a route to be

Re: [for-next V2 03/13] net/mlx5e: Wait for FPGA command responses with a timeout

2018-03-07 Thread Kirill Tkhai
On 07.03.2018 09:35, Saeed Mahameed wrote: > From: Aviad Yehezkel > > Generally, FPGA IPSec commands must always complete. > We want to wait for one minute for them to complete gracefully also > when killing a process. > > Signed-off-by: Aviad Yehezkel

[PATCH net-next 16/16] net: Convet ipv6_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations are similar to ipv4_net_ops. They are safe to be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/ne

[PATCH net-next 14/16] net: Convert iptable_security_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations unregister net::ipv4::iptable_security table. Another net/pernet_operations do not send ipv4 packets to foreign net namespaces. So, we mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/iptable_security.c |1 + 1 file chan

[PATCH net-next 15/16] net: Convert ipv4_net_ops

2018-03-07 Thread Kirill Tkhai
, the second one is just RO memory dereference. So, these pernet_operations are safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/netfilter/nf_conntrack_l3prot

[PATCH net-next 13/16] net: Convert iptable_raw_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations unregister net::ipv4::iptable_raw table. Another net/pernet_operations do not send ipv4 packets to foreign net namespaces. So, we mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/iptable_raw.c |1 + 1 file changed, 1 ins

[PATCH net-next 12/16] net: Convert iptable_nat_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations unregister net::ipv4::nat_table table. Another net/pernet_operations do not send ipv4 packets to foreign net namespaces. So, we mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/iptable_nat.c |1 + 1 file changed, 1 ins

[PATCH net-next 11/16] net: Convert iptable_mangle_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations unregister net::ipv4::iptable_mangle table. Another net/pernet_operations do not send ipv4 packets to foreign net namespaces. So, we mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/iptable_mangle.c |1 + 1 file chan

[PATCH net-next 09/16] net: Convert pg_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations create per-net pktgen threads and /proc entries. These pernet subsys looks closed in itself, and there are no pernet_operations outside this file, which are interested in the threads. Init and/or exit methods look safe to be executed in parallel. Signed-off-by: Kirill

[PATCH net-next 08/16] net: Convert nfnl_queue_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations register and unregister net::nf::queue_handler and /proc entry. The handler is accessed only under RCU, so this looks safe to convert them. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nfnetlink_queue.c |1 + 1 file changed, 1 ins

[PATCH net-next 10/16] net: Convert arptable_filter_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations unregister net::ipv4::arptable_filter. Another net/pernet_operations do not send arp packets to foreign net namespaces. So, we mark them async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/arptable_filter.c |1 + 1 file chan

[PATCH net-next 06/16] net: Convert cttimeout_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations also look closed in themself. Exit method touch only per-net structures, so it's safe to execute them for several net namespaces in parallel. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nfnetlink_cttimeout.c |1 + 1 file changed, 1 ins

[PATCH net-next 07/16] net: Convert nfnl_log_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations create and destroy /proc entries. Also, exit method unsets nfulnl_logger. The logger is not set by default, and it becomes bound via userspace request. So, they look safe to be made async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/net

[PATCH net-next 04/16] net: Convert nfnetlink_net_ops

2018-03-07 Thread Kirill Tkhai
it async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nfnetlink.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 03ead8a9e90c..84fc4954862d 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/net

[PATCH net-next 02/16] net: Convert xfrm_user_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations create and destroy net::xfrm::nlsk socket of NETLINK_XFRM. There is only entry point, where it's dereferenced, it's xfrm_user_rcv_msg(). There is no in-kernel senders to this socket. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/xfrm/xfrm_user.c |

[PATCH net-next 05/16] net: Convert nfnl_acct_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations look closed in themself, and there are no other users of net::nfnl_acct_list outside. They are safe to be executed for several net namespaces in parallel. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nfnetlink_acct.c |1 + 1 file chan

[PATCH net-next 03/16] net: Convert nf_tables_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations looks nicely separated per-net. Exit method unregisters net's nf tables objects. We allow them be executed in parallel. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nf_tables_api.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net-next 01/16] net: Convert ip6 tables pernet_operations

2018-03-07 Thread Kirill Tkhai
there must not be in-flight ipv6 packets at the time of pernet_operations execution and since pernet_operations don't send ipv6 packets each other, these pernet_operations are safe to be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv6/netfilter/ip6table_filter.c |1 + ne

[PATCH net-next 00/16] Converting pernet_operations (part #5)

2018-03-07 Thread Kirill Tkhai
. Thanks, Kirill --- Kirill Tkhai (16): net: Convert ip6 tables pernet_operations net: Convert xfrm_user_net_ops net: Convert nf_tables_net_ops net: Convert nfnetlink_net_ops net: Convert nfnl_acct_ops net: Convert cttimeout_ops net: Convert nfnl_log_net_ops

Re: [PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-07 Thread Kirill Tkhai
On 07.03.2018 12:22, Kirill Tkhai wrote: > On 06.03.2018 19:50, Eric Dumazet wrote: >> On Tue, 2018-03-06 at 19:24 +0300, Kirill Tkhai wrote: >>> After unshare test kworker hangs for ages: >>> >>> $ while :; do unshare -n true; done & >>> &

Re: [PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-07 Thread Kirill Tkhai
On 06.03.2018 19:50, Eric Dumazet wrote: > On Tue, 2018-03-06 at 19:24 +0300, Kirill Tkhai wrote: >> After unshare test kworker hangs for ages: >> >> $ while :; do unshare -n true; done & >> >> $ perf report >> -   88,82% 0,00%  kworker/

[PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-06 Thread Kirill Tkhai
. So, the progress of kworker becomes very slow. The patch introduces apparent solution, and it makes ip6mr_sk_done() to skip synchronize_rcu() for sockets, that are not need that. After the patch, kworker becomes able to warm the cpu up as expected. Signed-off-by: Kirill Tkhai <ktk...@virtuo

[PATCH net] net: Fix hlist corruptions in inet_evict_bucket()

2018-03-06 Thread Kirill Tkhai
go to stable. Fixes: d1fe19444d82 "inet: frag: don't re-use chainlist for evictor" Fixes: f84c6821aa54 "net: Convert pernet_subsys, registered from inet_init()" Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/inet_fragment.c |3 +++ 1 file changed, 3 in

Re: [BUG/Q] can_pernet_exit() leaves devices on dead net

2018-03-05 Thread Kirill Tkhai
Hi, Oliver, thanks for your reply. On 05.03.2018 16:59, Oliver Hartkopp wrote: > Hi Kirill, > > On 03/01/2018 04:53 PM, Kirill Tkhai wrote: > >> I'm converting/reviewing pernet_operations either they allow several net >> namespaces >> to be created/destroyed i

[PATCH net-next 09/12] net: Convert ip_set_net_ops

2018-03-05 Thread Kirill Tkhai
static inline func(void); #endif So, there are no more pernet operations, dereferencing net_generic(net, ip_set_net_id). ip_set_net_ops are OK to be executed in parallel for several net, so we mark them as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/net

[PATCH net-next 12/12] net: Convert proto_gre_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl. nf_conntrack_l4proto_gre4->init_net is simple memory initializer. Also, exit method removes gre keymap_list, which is per-net. This looks safe to be executed in parallel with other pernet_operations. Signed-off-by: Kirill Tkhai &

[PATCH net-next 11/12] net: Convert ctnetlink_net_ops

2018-03-05 Thread Kirill Tkhai
() is forgotten. But there is synchronize_rcu() on module exit patch (in ctnetlink_exit()), so this batch may be reworked as simple .exit method. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nf_conntrack_netlink.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/net

[PATCH net-next 07/12] net: Convert dccp_v6_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations looks similar to dccp_v4_ops, and they are also safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/dccp/ipv6.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 5df7857fc0f3..2f48c0

[PATCH net-next 08/12] net: Convert fou_net_ops

2018-03-05 Thread Kirill Tkhai
. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/fou.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 1540db65241a..d3e1a9af478b 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -1081,6 +1081,7 @@ static struct pernet_oper

[PATCH net-next 10/12] net: Convert nf_conntrack_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl and /proc entries. Exit batch method also waits till all per-net conntracks are dead. Thus, they are safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/netfilter/nf_conntrack_standalone.c |1 +

[PATCH net-next 02/12] net: Convert log pernet_operations

2018-03-05 Thread Kirill Tkhai
, nobody can send a packet after all netdevices are unregistered. So, these pernet_operations are able to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/bridge/netfilter/nf_log_bridge.c |1 + net/ipv4/netfilter/nf_log_arp.c |1 + net/ipv4/netfilter/nf_lo

[PATCH net-next 06/12] net: Convert dccp_v4_ops

2018-03-05 Thread Kirill Tkhai
as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/dccp/ipv4.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index e65fcb45c3f6..13ad28ab1e79 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -1031,6 +1031,7 @@ static

[PATCH net-next 05/12] net: Convert cangw_pernet_ops

2018-03-05 Thread Kirill Tkhai
such the messages. So, we mark them as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/can/gw.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/can/gw.c b/net/can/gw.c index 398dd0395ad9..08e97668d5cf 100644 --- a/net/can/gw.c +++ b/net/can/gw.c @@ -1010,6 +

[PATCH net-next 01/12] net: Convert broute_net_ops, frame_filter_net_ops and frame_nat_net_ops

2018-03-05 Thread Kirill Tkhai
are safe to be executed in parallel with any other. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/bridge/netfilter/ebtable_broute.c |1 + net/bridge/netfilter/ebtable_filter.c |1 + net/bridge/netfilter/ebtable_nat.c|1 + 3 files changed, 3 insertions(+) diff

[PATCH net-next 04/12] net: Convert caif_net_ops

2018-03-05 Thread Kirill Tkhai
. Since there are no kernel caif sockets nobody can send net a packet in parallel with init/exit, so this is also safe. So, these pernet_operations are safe to be async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/caif/caif_dev.c |1 + 1 file changed, 1 insertion(+) diff

[PATCH net-next 03/12] net: Convert arp_tables_net_ops and ip6_tables_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations call xt_proto_init() and xt_proto_fini(), which just register and unregister /proc entries. They are safe to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv4/netfilter/arp_tables.c |1 + net/ipv6/netfilter/ip6_tables.c |

[PATCH net-next 00/12] Converting pernet_operations (part #4)

2018-03-05 Thread Kirill Tkhai
Hi, this series continues to review and to convert pernet_operations to make them possible to be executed in parallel for several net namespaces in the same time. The patches touch mostly netfilter, also there are small number of changes in other places. Thanks, Kirill --- Kirill Tkhai (12

Re: [PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA

2018-03-02 Thread Kirill Tkhai
On 01.03.2018 20:22, Benjamin Beichler wrote: > Am 01.03.2018 um 12:30 schrieb Kirill Tkhai: > >> Out of bounds of this patch, just as a report to wireless subsystem >> maintainer, destroy_radio() increaments hwsim_radios_generation >> without hwsim_radio_lock, so this

[BUG/Q] can_pernet_exit() leaves devices on dead net

2018-03-01 Thread Kirill Tkhai
Hi, I'm converting/reviewing pernet_operations either they allow several net namespaces to be created/destroyed in parallel or not. Please, see the details in my recent patches in net-next.git, if your are interested. There is a strange place in can_pernet_ops pernet subsys, I found: static

Re: KASAN: use-after-free Read in mac80211_hwsim_del_radio

2018-03-01 Thread Kirill Tkhai
Hi, 01.03.2018, 11:46, "syzbot" : > Hello, > > syzbot hit the following crash on upstream commit > f3afe530d644488a074291da04a69a296ab63046 (Tue Feb 27 22:02:39 2018 +) > Merge branch 'fixes-v4.16-rc4' of >

[PATCH net-next] net: Make account struct net to memcg

2018-03-01 Thread Kirill Tkhai
. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/core/net_namespace.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 690e78c6af45..c340d5cfbdec 100644 --- a/net/core/net_namespace.c +++ b/ne

[PATCH net-next 2/2] net: Convert hwsim_net_ops

2018-03-01 Thread Kirill Tkhai
destroy_radio() work, and these work already may be executed in parallel with any pernet_operations (as it's a work :). So, we may mark these pernet_operations as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- drivers/net/wireless/mac80211_hwsim.c |1 + 1 file changed, 1 insertion(+)

[PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA

2018-03-01 Thread Kirill Tkhai
as a report to wireless subsystem maintainer, destroy_radio() increaments hwsim_radios_generation without hwsim_radio_lock, so this may need one more patch to fix. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- drivers/net/wireless/mac80211_hwsim.c | 14 -- 1 file chan

[PATCH net-next 0/2] Converting pernet_operations (part #3) (wireless, mac80211_hwsim)

2018-03-01 Thread Kirill Tkhai
These series fixes ID overflow of hwsim_netgroup [1/2], and reviews and makes hwsim_net_ops as async [2/2]. The first pernet_operations requiring changes to make the converting safe! ([1/2] may be need to [net], but better people see it's really need). Thanks, Kirill --- Kirill Tkhai (2

[PATCH net-next 27/28] net: Convert selinux_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only register and unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- security/selinux/hooks.c |1 + 1 file changed, 1 insertion(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c

[PATCH net-next 28/28] net: Convert smack_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only register and unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- security/smack/smack_netfilter.c |1 + 1 file changed, 1 insertion(+) diff --git a/security/smack/smack_netfilter.c b/security

[PATCH net-next 25/28] net: Convert ila_net_ops

2018-02-26 Thread Kirill Tkhai
, they are able to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv6/ila/ila_xlat.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 44c39c5f0638..e438699f000f 100644 --- a/net/ipv6/ila/ila_xlat.c

[PATCH net-next 26/28] net: Convert defrag6_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai <ktk...@virtuozzo.com> --- net/ipv6/netfilter/nf_defrag_ipv6_hooks.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/ne

<    1   2   3   4   5   >