diff options
author | Eric W. Biederman <eric@conroxe.ebiederm.org> | 2009-11-29 17:25:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-01 19:15:51 -0500 |
commit | 2b035b39970740722598f7a9d548835f9bdd730f (patch) | |
tree | a240b595c380b50f783fe8b3d3d4e9cb612cbb30 /include/net | |
parent | dcbccbd4f1f6ad0f0e169d4b2e816e42bde06f82 (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')
-rw-r--r-- | include/net/net_namespace.h | 2 |
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 { | |||
42 | */ | 42 | */ |
43 | #endif | 43 | #endif |
44 | struct list_head list; /* list of network namespaces */ | 44 | struct list_head list; /* list of network namespaces */ |
45 | struct work_struct work; /* work struct for freeing */ | 45 | struct list_head cleanup_list; /* namespaces on death row */ |
46 | 46 | ||
47 | struct proc_dir_entry *proc_net; | 47 | struct proc_dir_entry *proc_net; |
48 | struct proc_dir_entry *proc_net_stat; | 48 | struct proc_dir_entry *proc_net_stat; |