[RH7,01/11] Revert net: limit a number of namespaces which can be cleaned up concurrently

Submitted by Kirill Tkhai on May 27, 2020, 3:53 p.m.

Details

Message ID 159059482123.408928.14908014599163889977.stgit@localhost.localdomain
State New
Series "Parallel per-net init/exit"
Headers show

Commit Message

Kirill Tkhai May 27, 2020, 3:53 p.m.
rwsem series will fix this problem properly.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 net/core/net_namespace.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

Patch hide | download patch | download mbox

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 240a3a593a66..767f247ccfc2 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -437,26 +437,12 @@  static void cleanup_net(struct work_struct *work)
 	struct net *net, *tmp;
 	struct list_head net_kill_list;
 	LIST_HEAD(net_exit_list);
-	bool reload = false;
-	int i = 0;
 
 	/* Atomically snapshot the list of namespaces to cleanup */
 	spin_lock_irq(&cleanup_list_lock);
-	list_for_each_entry_safe(net, tmp, &cleanup_list, cleanup_list)
-		if (++i == 16)
-			break;
-
-	if (i == 16) {
-		list_cut_position(&net_kill_list, &cleanup_list,
-						&net->cleanup_list);
-		reload = true;
-	} else
-		list_replace_init(&cleanup_list, &net_kill_list);
+	list_replace_init(&cleanup_list, &net_kill_list);
 	spin_unlock_irq(&cleanup_list_lock);
 
-	if (reload)
-		queue_work(netns_wq, work);
-
 	mutex_lock(&net_mutex);
 
 	/* Don't let anyone else find us. */