From 4d89dc6ab2711258bfd12c72d753f3ad56b244e2 Mon Sep 17 00:00:00 2001 From: Nadia Derbey Date: Tue, 29 Apr 2008 01:00:40 -0700 Subject: ipc: scale msgmni to the number of ipc namespaces Since all the namespaces see the same amount of memory (the total one) this patch introduces a new variable that counts the ipc namespaces and divides msg_ctlmni by this counter. Signed-off-by: Nadia Derbey Cc: Yasunori Goto Cc: Matt Helsley Cc: Mingming Cao Cc: Pierre Peiffer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- ipc/namespace.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ipc/namespace.c') diff --git a/ipc/namespace.c b/ipc/namespace.c index 1b967655eb3..fe3c97aa99d 100644 --- a/ipc/namespace.c +++ b/ipc/namespace.c @@ -20,6 +20,8 @@ static struct ipc_namespace *clone_ipc_ns(struct ipc_namespace *old_ns) if (ns == NULL) return ERR_PTR(-ENOMEM); + atomic_inc(&nr_ipc_ns); + sem_init_ns(ns); msg_init_ns(ns); shm_init_ns(ns); @@ -83,4 +85,5 @@ void free_ipc_ns(struct kref *kref) msg_exit_ns(ns); shm_exit_ns(ns); kfree(ns); + atomic_dec(&nr_ipc_ns); } -- cgit v1.2.3