Commit:     3ef1355dcb8551730cc71e9ef4363f5c66ccad17
Parent:     85b606800be20ceeca36bd8594c1eb228d2fb2f4
Author:     Benjamin Thery <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 23:18:16 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:54:35 2008 -0800

    [NET]: Make netns cleanup to run in a separate queue
    This patch adds a separate workqueue for cleaning up a network
    namespace. If we use the keventd workqueue to execute cleanup_net(),
    there is a problem to unregister devices in IPv6. Indeed the code
    that cleans up also schedule work in keventd: as long as cleanup_net()
    hasn't return, dst_gc_task() cannot run and as long as dst_gc_task() has
    not run, there are still some references pending on the net devices and
    cleanup_net() can not unregister and exit the keventd workqueue.
    Signed-off-by: Benjamin Thery <[EMAIL PROTECTED]>
    Signed-off-by: Daniel Lezcano <[EMAIL PROTECTED]>
    Acked-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Acked-By: Kirill Korotaev <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 net/core/net_namespace.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index ec936ae..26e941d 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -58,6 +58,7 @@ out_undo:
 static struct kmem_cache *net_cachep;
+static struct workqueue_struct *netns_wq;
 static struct net *net_alloc(void)
@@ -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);
@@ -171,7 +172,13 @@ static int __init net_ns_init(void)
        net_cachep = kmem_cache_create("net_namespace", sizeof(struct net),
                                        SLAB_PANIC, NULL);
+       /* Create workqueue for cleanup */
+       netns_wq = create_singlethread_workqueue("netns");
+       if (!netns_wq)
+               panic("Could not create netns workq");
        err = setup_net(&init_net);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to