summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-10-18 23:39:48 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 11:53:37 -0700
commitbaf8f0f82dd79e374bf6fa9e996393df2bae3c21 (patch)
tree2cf18de413871812527147cd8fbf32d1dbbe7bee /include/linux
parenta05f7b15deb2903d9f0b5df33ddd4d186d5ecac1 (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.h1
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 {
struct pidmap pidmap[PIDMAP_ENTRIES];
int last_pid;
struct task_struct *child_reaper;
+ struct kmem_cache *pid_cachep;
};
extern struct pid_namespace init_pid_ns;