diff options
author | Pavel Emelianov <xemul@openvz.org> | 2007-10-19 02:39:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:37 -0400 |
commit | baf8f0f82dd79e374bf6fa9e996393df2bae3c21 (patch) | |
tree | 2cf18de413871812527147cd8fbf32d1dbbe7bee /include/linux | |
parent | a05f7b15deb2903d9f0b5df33ddd4d186d5ecac1 (diff) |
pid namespaces: dynamic kmem cache allocator for pid namespaces
Add kmem_cache to pid_namespace to allocate pids from.
Since both implementations expand the struct pid to carry more numerical
values each namespace should have separate cache to store pids of different
sizes.
Each kmem cache is name "pid_<NR>", where <NR> is the number of numerical ids
on the pid. Different namespaces with same level of nesting will have same
caches.
This patch has two FIXMEs that are to be fixed after we reach the consensus
about the struct pid itself.
The first one is that the namespace to free the pid from in free_pid() must be
taken from pid. Now the init_pid_ns is used.
The second FIXME is about the cache allocation. When we do know how long the
object will be then we'll have to calculate this size in create_pid_cachep.
Right now the sizeof(struct pid) value is used.
[akpm@linux-foundation.org: coding-style repair]
Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Acked-by: Cedric Le Goater <clg@fr.ibm.com>
Acked-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pid_namespace.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index ddb9a4c95968..c471c0c6e9ce 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -20,6 +20,7 @@ struct pid_namespace { | |||
20 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 20 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
21 | int last_pid; | 21 | int last_pid; |
22 | struct task_struct *child_reaper; | 22 | struct task_struct *child_reaper; |
23 | struct kmem_cache *pid_cachep; | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | extern struct pid_namespace init_pid_ns; | 26 | extern struct pid_namespace init_pid_ns; |