<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/ipc/ipc_sysctl.c, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/ipc/ipc_sysctl.c?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/ipc/ipc_sysctl.c?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-11-03T18:53:11Z</updated>
<entry>
<title>ipc, msg: forbid negative values for "msg{max,mnb,mni}"</title>
<updated>2013-11-03T18:53:11Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2013-11-03T11:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9bf76ca325d5e9208eb343f7bd4cc666f703ed30'/>
<id>urn:sha1:9bf76ca325d5e9208eb343f7bd4cc666f703ed30</id>
<content type='text'>
Negative message lengths make no sense -- so don't do negative queue
lenghts or identifier counts. Prevent them from getting negative.

Also change the underlying data types to be unsigned to avoid hairy
surprises with sign extensions in cases where those variables get
evaluated in unsigned expressions with bigger data types, e.g size_t.

In case a user still wants to have "unlimited" sizes she could just use
INT_MAX instead.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: add sysctl to specify desired next object id</title>
<updated>2013-01-05T00:11:45Z</updated>
<author>
<name>Stanislav Kinsbursky</name>
<email>skinsbursky@parallels.com</email>
</author>
<published>2013-01-04T23:34:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=03f595668017f1a1fb971c02fc37140bc6e7bb1c'/>
<id>urn:sha1:03f595668017f1a1fb971c02fc37140bc6e7bb1c</id>
<content type='text'>
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).

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Stanislav Kinsbursky &lt;skinsbursky@parallels.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: introduce shm_rmid_forced sysctl</title>
<updated>2011-07-26T23:49:44Z</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segoon@openwall.com</email>
</author>
<published>2011-07-26T23:08:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b34a6b1da371ed8af1221459a18c67970f7e3d53'/>
<id>urn:sha1:b34a6b1da371ed8af1221459a18c67970f7e3d53</id>
<content type='text'>
Add support for the shm_rmid_forced sysctl.  If set to 1, all shared
memory objects in current ipc namespace will be automatically forced to
use IPC_RMID.

The POSIX way of handling shmem allows one to create shm objects and
call shmdt(), leaving shm object associated with no process, thus
consuming memory not counted via rlimits.

With shm_rmid_forced=1 the shared memory object is counted at least for
one process, so OOM killer may effectively kill the fat process holding
the shared memory.

It obviously breaks POSIX - some programs relying on the feature would
stop working.  So set shm_rmid_forced=1 only if you're sure nobody uses
"orphaned" memory.  Use shm_rmid_forced=0 by default for compatability
reasons.

The feature was previously impemented in -ow as a configure option.

[akpm@linux-foundation.org: fix documentation, per Randy]
[akpm@linux-foundation.org: fix warning]
[akpm@linux-foundation.org: readability/conventionality tweaks]
[akpm@linux-foundation.org: fix shm_rmid_forced/shm_forced_rmid confusion, use standard comment layout]
Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: "Serge E. Hallyn" &lt;serge.hallyn@canonical.com&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@free.fr&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Solar Designer &lt;solar@openwall.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sysctl ipc: Remove dead binary sysctl support code.</title>
<updated>2009-11-12T10:04:54Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2009-04-03T09:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2bc4657c15e4a33d9a192579c7627a397dbcbebc'/>
<id>urn:sha1:2bc4657c15e4a33d9a192579c7627a397dbcbebc</id>
<content type='text'>
Now that sys_sysctl is a generic wrapper around /proc/sys  .ctl_name
and .strategy members of sysctl tables are dead code.  Remove them.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>sysctl: remove "struct file *" argument of -&gt;proc_handler</title>
<updated>2009-09-24T14:21:04Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-09-23T22:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8d65af789f3e2cf4cfbdbf71a0f7a61ebcd41d38'/>
<id>urn:sha1:8d65af789f3e2cf4cfbdbf71a0f7a61ebcd41d38</id>
<content type='text'>
It's unused.

It isn't needed -- read or write flag is already passed and sysctl
shouldn't care about the rest.

It _was_ used in two places at arch/frv for some reason.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc_sysctl: use CONFIG_PROC_SYSCTL around ipc and utsname proc_handlers</title>
<updated>2009-04-03T02:05:01Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serue@us.ibm.com</email>
</author>
<published>2009-04-02T23:58:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=11dea1900931ac73184b2f5163a13d24a4e572ea'/>
<id>urn:sha1:11dea1900931ac73184b2f5163a13d24a4e572ea</id>
<content type='text'>
As pointed out by Cedric Le Goater (in response to Alexey's original
comment wrt mqns), ipc_sysctl.c and utsname_sysctl.c are using
CONFIG_PROC_FS, not CONFIG_PROC_SYSCTL, to determine whether to define
the proc_handlers.  Change that.

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Acked-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc/ipc_sysctl.c: move the definition of ipc_auto_callback()</title>
<updated>2009-01-06T23:59:29Z</updated>
<author>
<name>akpm@linux-foundation.org</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2009-01-06T22:42:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4c2c3b4aaf3c10a636490438e9648a314ce414f9'/>
<id>urn:sha1:4c2c3b4aaf3c10a636490438e9648a314ce414f9</id>
<content type='text'>
proc_ipcauto_dointvec_minmax() is the only user of ipc_auto_callback(),
since the former function is protected by CONFIG_PROC_FS, so should be the
latter one.

Just move its definition down.

Signed-off-by: WANG Cong &lt;wangcong@zeuux.org&gt;
Cc: Eric Biederman &lt;ebiederm@xmision.com&gt;
Cc: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sysctl: simplify -&gt;strategy</title>
<updated>2008-10-16T18:21:47Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2008-10-16T05:04:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f221e726bf4e082a05dcd573379ac859bfba7126'/>
<id>urn:sha1:f221e726bf4e082a05dcd573379ac859bfba7126</id>
<content type='text'>
name and nlen parameters passed to -&gt;strategy hook are unused, remove
them.  In general -&gt;strategy hook should know what it's doing, and don't
do something tricky for which, say, pointer to original userspace array
may be needed (name).

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt; [ networking bits ]
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: do not use a negative value to re-enable msgmni automatic recomputing</title>
<updated>2008-07-25T17:53:42Z</updated>
<author>
<name>Nadia Derbey</name>
<email>Nadia.Derbey@bull.net</email>
</author>
<published>2008-07-25T08:48:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9eefe520c814f6f62c5d36a2ddcd3fb99dfdb30e'/>
<id>urn:sha1:9eefe520c814f6f62c5d36a2ddcd3fb99dfdb30e</id>
<content type='text'>
This patch proposes an alternative to the "magical
positive-versus-negative number trick" Andrew complained about last week
in http://lkml.org/lkml/2008/6/24/418.

This had been introduced with the patches that scale msgmni to the amount
of lowmem.  With these patches, msgmni has a registered notification
routine that recomputes msgmni value upon memory add/remove or ipc
namespace creation/ removal.

When msgmni is changed from user space (i.e.  value written to the proc
file), that notification routine is unregistered, and the way to make it
registered back is to write a negative value into the proc file.  This is
the "magical positive-versus-negative number trick".

To fix this, a new proc file is introduced: /proc/sys/kernel/auto_msgmni.
This file acts as ON/OFF for msgmni automatic recomputing.

With this patch, the process is the following:
1) kernel boots in "automatic recomputing mode"
   /proc/sys/kernel/msgmni contains the value that has been computed (depends
                           on lowmem)
   /proc/sys/kernel/automatic_msgmni contains "1"

2) echo &lt;val&gt; &gt; /proc/sys/kernel/msgmni
   . sets msg_ctlmni to &lt;val&gt;
   . de-activates automatic recomputing (i.e. if, say, some memory is added
     msgmni won't be recomputed anymore)
   . /proc/sys/kernel/automatic_msgmni now contains "0"

3) echo "0" &gt; /proc/sys/kernel/automatic_msgmni
   . de-activates msgmni automatic recomputing
     this has the same effect as 2) except that msg_ctlmni's value stays
     blocked at its current value)

3) echo "1" &gt; /proc/sys/kernel/automatic_msgmni
   . recomputes msgmni's value based on the current available memory size
     and number of ipc namespaces
   . re-activates automatic recomputing for msgmni.

Signed-off-by: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Solofo Ramangalahy &lt;Solofo.Ramangalahy@bull.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ipc: re-enable msgmni automatic recomputing msgmni if set to negative</title>
<updated>2008-04-29T15:06:13Z</updated>
<author>
<name>Nadia Derbey</name>
<email>Nadia.Derbey@bull.net</email>
</author>
<published>2008-04-29T08:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6546bc4279241e8fa432de1bb63a4f6f791fd669'/>
<id>urn:sha1:6546bc4279241e8fa432de1bb63a4f6f791fd669</id>
<content type='text'>
The enhancement as asked for by Yasunori: if msgmni is set to a negative
value, register it back into the ipcns notifier chain.

A new interface has been added to the notification mechanism:
notifier_chain_cond_register() registers a notifier block only if not already
registered.  With that new interface we avoid taking care of the states
changes in procfs.

Signed-off-by: Nadia Derbey &lt;Nadia.Derbey@bull.net&gt;
Cc: Yasunori Goto &lt;y-goto@jp.fujitsu.com&gt;
Cc: Matt Helsley &lt;matthltc@us.ibm.com&gt;
Cc: Mingming Cao &lt;cmm@us.ibm.com&gt;
Cc: Pierre Peiffer &lt;pierre.peiffer@bull.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
