All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)
@ 2018-03-16 12:38 Kirill Tkhai
  2018-03-16 13:00 ` Sowmini Varadhan
  0 siblings, 1 reply; 19+ messages in thread
From: Kirill Tkhai @ 2018-03-16 12:38 UTC (permalink / raw)
  To: santosh.shilimkar, davem, netdev, linux-rdma, rds-devel,
	edumazet, ktkhai, sowmini.varadhan

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 added NETDEV_UNREGISTER_FINAL dependence
with the commentary:

	/* rds-tcp registers as a pernet subys, so the ->exit will only
	 * get invoked after network acitivity has quiesced. We need to
	 * clean up all sockets  to quiesce network activity, and use
	 * the unregistration of the per-net loopback device as a trigger
	 * to start that cleanup.
	 */

It seems all the protocols pernet subsystems meet this situation, but they
solve it in generic way. What does rds so specific have?

This commit makes event handler to iterate rds_tcp_conn_list and
kill them. If we change the stage to NETDEV_UNREGISTER, what will change?
Can unregistered loopback device on dead net add new items to rds_tcp_conn_list?
How it's possible?

What the problem is to move rds_tcp_kill_sock() into pernet subsys exit?

Kirill
---
 net/rds/tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index eb04e7fa2467..4c6db9cb6261 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -567,7 +567,7 @@ static int rds_tcp_dev_event(struct notifier_block *this,
 	 * the unregistration of the per-net loopback device as a trigger
 	 * to start that cleanup.
 	 */
-	if (event == NETDEV_UNREGISTER_FINAL &&
+	if (event == NETDEV_UNREGISTER &&
 	    dev->ifindex == LOOPBACK_IFINDEX)
 		rds_tcp_kill_sock(dev_net(dev));
 

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

end of thread, other threads:[~2018-03-20 13:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 12:38 [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL) Kirill Tkhai
2018-03-16 13:00 ` Sowmini Varadhan
2018-03-16 13:17   ` Kirill Tkhai
2018-03-16 13:53     ` Sowmini Varadhan
2018-03-16 14:36       ` Kirill Tkhai
2018-03-16 14:41         ` Kirill Tkhai
2018-03-16 17:29     ` Sowmini Varadhan
2018-03-16 18:14       ` Kirill Tkhai
2018-03-16 18:31         ` Sowmini Varadhan
2018-03-16 18:48           ` Kirill Tkhai
2018-03-16 18:53             ` Sowmini Varadhan
2018-03-17 14:15         ` Sowmini Varadhan
2018-03-17 21:13           ` Kirill Tkhai
2018-03-17 21:26           ` [rds-devel] " Sowmini Varadhan
2018-03-17 21:55             ` Kirill Tkhai
2018-03-18 20:45               ` Sowmini Varadhan
2018-03-19 10:08                 ` Kirill Tkhai
2018-03-20 11:37                 ` Håkon Bugge
2018-03-20 13:29                   ` Sowmini Varadhan

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.