summaryrefslogtreecommitdiff
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorEric W. Biederman <eric@conroxe.ebiederm.org>2009-11-29 22:25:27 +0000
committerDavid S. Miller <davem@davemloft.net>2009-12-01 16:15:51 -0800
commit2b035b39970740722598f7a9d548835f9bdd730f (patch)
treea240b595c380b50f783fe8b3d3d4e9cb612cbb30 /include/net/net_namespace.h
parentdcbccbd4f1f6ad0f0e169d4b2e816e42bde06f82 (diff)
net: Batch network namespace destruction.
It is fairly common to kill several network namespaces at once. Either because they are nested one inside the other or because they are cooperating in multiple machine networking experiments. As the network stack control logic does not parallelize easily batch up multiple network namespaces existing together. To get the full benefit of batching the virtual network devices to be removed must be all removed in one batch. For that purpose I have added a loop after the last network device operations have run that batches up all remaining network devices and deletes them. An extra benefit is that the reorganization slightly shrinks the size of the per network namespace data structures replaceing a work_struct with a list_head. In a trivial test with 4K namespaces this change reduced the cost of a destroying 4K namespaces from 7+ minutes (at 12% cpu) to 44 seconds (at 60% cpu). The bulk of that 44s was spent in inet_twsk_purge. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 0addd45038ac..d69b4796030f 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -42,7 +42,7 @@ struct net {
*/
#endif
struct list_head list; /* list of network namespaces */
- struct work_struct work; /* work struct for freeing */
+ struct list_head cleanup_list; /* namespaces on death row */
struct proc_dir_entry *proc_net;
struct proc_dir_entry *proc_net_stat;