[Devel] [PATCH RH7 01/11] Revert net: limit a number of namespaces which can be cleaned up concurrently
Kirill Tkhai
ktkhai at virtuozzo.com
Wed May 27 18:53:41 MSK 2020
rwsem series will fix this problem properly.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
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 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. */
More information about the Devel
mailing list