All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make netns cleanup to run in a separate workq
@ 2007-11-19  9:32 Daniel Lezcano
       [not found] ` <4741583F.3050302-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lezcano @ 2007-11-19  9:32 UTC (permalink / raw)
  To: Denis V. Lunev
  Cc: Linux Containers, Benjamin Thery, Eric W. Biederman,
	Pavel Emelianov

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: create-workq-for-the-namespace.patch --]
[-- Type: text/x-patch, Size: 1335 bytes --]

Subject: make netns cleanup to run in a separate queue
From: Benjamin Thery

Signed-off-by: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Benjamin Thery <benjamin.thery-6ktuUTfB/bM@public.gmane.org>
---
 net/core/net_namespace.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux-2.6-netns/net/core/net_namespace.c
===================================================================
--- linux-2.6-netns.orig/net/core/net_namespace.c
+++ linux-2.6-netns/net/core/net_namespace.c
@@ -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);
 

[-- Attachment #3: Type: text/plain, Size: 206 bytes --]

_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers

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

end of thread, other threads:[~2007-11-19  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19  9:32 [PATCH] make netns cleanup to run in a separate workq Daniel Lezcano
     [not found] ` <4741583F.3050302-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-11-19  9:46   ` Denis V. Lunev
     [not found]     ` <47415B60.4060306-3ImXcnM4P+0@public.gmane.org>
2007-11-19  9:44       ` Daniel Lezcano

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.