]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc: add sysctl to specify desired next object id
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Thu, 25 Oct 2012 01:15:17 +0000 (12:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 2 Nov 2012 05:01:02 +0000 (16:01 +1100)
commit6fb473164643123917808629ce01e6f33f059c8e
treec1f1a67964b45912cacad2d8bde99a02489f89d0
parent844e330b827dc6b2fae6cacd16c186d6494a9142
ipc: add sysctl to specify desired next object id

Add 3 new variables and sysctls to tune them (by one "next_id" variable
for messages, semaphores and shared memory respectively).  This variable
can be used to set desired id for next allocated IPC object.  By default
it's equal to -1 and old behaviour is preserved.  If this variable is
non-negative, then desired idr will be extracted from it and used as a
start value to search for free IDR slot.

Notes:

1) this patch doesn't guarantee that the new object will have desired
   id.  So it's up to user space how to handle new object with wrong id.

2) After a sucessful id allocation attempt, "next_id" will be set back
   to -1 (if it was non-negative).

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/ipc_namespace.h
ipc/ipc_sysctl.c
ipc/util.c
ipc/util.h