[Devel] [PATCH RHEL7 COMMIT] Revert net: limit a number of namespaces which can be cleaned up concurrently

Konstantin Khorenko khorenko at virtuozzo.com
Wed May 27 21:34:51 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1127.8.2.vz7.161.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.8.2.vz7.161.3
------>
commit c4553160eb0f3d866bb4f895c01e75ed4e8a0a04
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Wed May 27 21:34:50 2020 +0300

    Revert net: limit a number of namespaces which can be cleaned up concurrently
    
    rwsem series will fix this problem properly.
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    
    =====================
    Patchset description:
    
    Parallel per-net init/exit
    
    https://jira.sw.ru/browse/PSBM-104158
---
 net/core/net_namespace.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index ee673ead5f04c..ba2c8077eb883 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -435,26 +435,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. */


More information about the Devel mailing list