[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1259843349-3810-4-git-send-email-ebiederm@xmission.com>
Date: Thu, 3 Dec 2009 04:29:06 -0800
From: "Eric W. Biederman" <ebiederm@...ssion.com>
To: David Miller <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>, jamal <hadi@...erus.ca>,
Daniel Lezcano <dlezcano@...ibm.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: [PATCH 4/7] netns: Add an explicit rcu_barrier to unregister_pernet_{device|subsys}
From: Eric W. Biederman <ebiederm@...ssion.com>
This allows namespace exit methods to batch work that comes requires an
rcu barrier using call_rcu without having to treat the
unregister_pernet_operations cases specially.
Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
---
net/core/net_namespace.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 4026a4c..bd8c471 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -413,8 +413,11 @@ again:
}
}
error = __register_pernet_operations(list, ops);
- if (error && ops->id)
- ida_remove(&net_generic_ids, *ops->id);
+ if (error) {
+ rcu_barrier();
+ if (ops->id)
+ ida_remove(&net_generic_ids, *ops->id);
+ }
return error;
}
@@ -423,6 +426,7 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
{
__unregister_pernet_operations(ops);
+ rcu_barrier();
if (ops->id)
ida_remove(&net_generic_ids, *ops->id);
}
--
1.6.5.2.143.g8cc62
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists