mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Cc: Yasunori Goto <[email protected]> Cc: Matt Helsley <[email protected]> Cc: Mingming Cao <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
f7bf3df8be
commit
4d89dc6ab2
4 changed files with 14 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue