init method initializes sysctl defaults, allocates
percpu arrays and creates /proc entries.
exit method reverts the above.
There are no pernet_operations, which are interested
in the above entities of foreign net namespace, so
inet6_net_ops are able to be marked as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/af_inet6.c | 1 +
1 file changed, 1 insertion(+)
This patch finishes converting pernet_operations
registered in net/wireless directory.
These pernet_operations have only exit method,
which moves devices to init_net. This action
is not pernet_operations-specific, and function
cfg80211_switch_netns() may be called all time
during the system life. All necessary protection
against concurrent cfg80211_pernet_exit() is made
by rtnl_lock(). So, cfg80211_pernet_ops is able
to be marked as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/wireless/core.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create and destroy /proc entries,
populate and depopulate net::rules_ops and multiroute table.
All the structures are pernet, and they are not touched
by foreign net pernet_operations. So, it's possible to mark
them async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/ip6mr.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create and destroy net::ipv6.icmp_sk
socket, used to send ICMP or error reply.
Nobody can dereference the socket to handle a packet before
net is initialized, as there is no routing; nobody can do
that in parallel with exit, as all of devices are moved
to init_net or destroyed and there are no packets it-flight.
So, it's possible to mark these pernet_operations as async.
The same for ndisc_net_ops and for igmp6_net_ops. The last
one also creates and destroys /proc entries.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/icmp.c | 1 +
net/ipv6/mcast.c | 1 +
net/ipv6/ndisc.c | 1 +
3 files changed, 3 insertions(+)
These pernet_operations create and destroy /proc entries
and safely may be converted and safely may be mark as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/addrconf.c | 1 +
net/ipv6/proc.c | 1 +
net/ipv6/raw.c | 1 +
net/ipv6/route.c | 2 ++
4 files changed, 5 insertions(+)
net->ipv6.peers is dereferenced in three places via inet_getpeer_v6(),
and it's used to handle skb. All the users of inet_getpeer_v6() do not
look like be able to be called from foreign net pernet_operations, so
we may mark them as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/route.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations register and unregister
net::ipv6.fib6_rules_ops, which are used for
routing. It looks like there are no pernet_operations,
which send ipv6 packages to another net, so we
are able to mark them as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/fib6_rules.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create and destroy net::ipv6.tcp_sk
socket, which is used in tcp_v6_send_response() only. It looks
like foreign pernet_operations don't want to set ipv6 connection
inside destroyed net, so this socket may be created in destroyed
in parallel with anything else. inet_twsk_purge() is also safe
for that, as described in patch for tcp_sk_ops. So, it's possible
to mark them as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/tcp_ipv6.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create and destroy sysctl tables.
They are not touched by another net pernet_operations.
So, it's possible to execute them in parallel with others.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/sysctl_net_ipv6.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations only register and unregister /proc
entries, so it's possible to mark them async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/ping.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create and destroy /proc entries.
ip6_fl_purge() makes almost the same actions as timer
ip6_fl_gc_timer does, and as it can be executed in parallel
with ip6_fl_purge(), two parallel ip6_fl_purge() may be
executed. So, we can mark it async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/ip6_flowlabel.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations create sysctl tables and
initialize net::xfrm.xfrm6_dst_ops used for routing.
It doesn't look like another pernet_operations send
ipv6 packets to foreign net namespaces, so it should
be safe to mark the pernet_operations as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/xfrm6_policy.c | 1 +
1 file changed, 1 insertion(+)
These pernet_operations register and unregister tables
and lists for packets forwarding. All of the entities
are per-net. Init methods makes simple initializations,
and since net is not visible for foreigners at the time
it is working, it can't race with anything. Exit method
is executed when there are only local devices, and there
mustn't be packets in-flight. Also, it looks like no one
pernet_operations want to send ipv6 packets to foreign
net. The same reasons are for ipv6_addr_label_ops and
ip6_segments_ops. So, we are able to mark all them as
async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/addrlabel.c | 1 +
net/ipv6/ip6_fib.c | 1 +
net/ipv6/seg6.c | 1 +
3 files changed, 3 insertions(+)
Exit methods calls inet_frags_exit_net() with global ip6_frags
as argument. So, after we make the pernet_operations async,
a pair of exit methods may be called to iterate this hash table.
Since there is inet_frag_worker(), which already may work
in parallel with inet_frags_exit_net(), and it can make the same
cleanup, that inet_frags_exit_net() does, it's safe. So we may
mark these pernet_operations as async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv6/reassembly.c | 1 +
1 file changed, 1 insertion(+)
ip_tables_net_ops and udplite6_net_ops create and destroy /proc entries.
xt_net_ops does nothing.
So, we are able to mark them async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv4/netfilter/ip_tables.c | 1 +
net/ipv6/udplite.c | 1 +
net/netfilter/x_tables.c | 1 +
3 files changed, 3 insertions(+)
These pernet_operations register and unregister
net::ipv4.iptable_filter table. Since there are
no packets in-flight at the time of exit method
is working, iptables rules should not be touched.
Also, pernet_operations should not send ipv4
packets each other. So, it's safe to mark them
async.
Signed-off-by: Kirill Tkhai <redacted>
---
net/ipv4/netfilter/iptable_filter.c | 1 +
1 file changed, 1 insertion(+)
This patchset continues to review and to convert pernet_operations
to async. There are mostly ipv6, also some regular used netfilter
pernet_operations are involved. One more converted is cfg80211_pernet_ops.
Series applied.
Thanks for explaining why each transformation to async is legitimate
in each and every commit message, it made the review of this series
that much easier.