make netns cleanup to run in a separate workq
PATCH 1/1 make netns cleanup to run in a separate workq
Subject: make netns cleanup to run in a separate queue
From: Benjamin Thery
--- net/core/net_namespace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/core/net_namespace.c +8 -1
@@ -14,6 +14,7 @@static LIST_HEAD (pernet_list);static struct list_head *first_device = &pernet_list;static DEFINE_MUTEX (net_mutex); +static struct workqueue_struct *netns_wq;LIST_HEAD (net_namespace_list);
@@ -149,7 +150,7 @@ void __put_net(struct net *net) {/* Cleanup the network namespace in process context */ INIT_WORK (&net->work, cleanup_net); -schedule_work (&net->work); +queue_work (netns_wq, &net->work); }EXPORT_SYMBOL_GPL (__put_net);
@@ -172,6 +173,12 @@ static int __init net_ns_init(void)SMP_CACHE_BYTES , SLAB_PANIC, NULL);#endif + +/* Create workqueue for cleanup */ + netns_wq =create_singlethread_workqueue ("netns" ); +if (!netns_wq) +panic ("Could not create netns cleaner" ); +mutex_lock (&net_mutex); err =setup_net (&init_net);
_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): 4741583F.3050302-NmTC/[email protected]
Denis V. Lunev
Acked-byDaniel Lezcano wrote:
Though, could you insert original problem description into the comment? This change is not obvious one?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Denis V. Lunev
Daniel Lezcano wrote:
Acked-by Denis V. Lunev <[email protected]>Though, could you insert original problem description into the comment? This change is not obvious one?
Sure.
thanks.