aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sysctl
diff options
context:
space:
mode:
authorVasiliy Kulikov <segoon@openwall.com>2011-07-26 19:08:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 19:49:44 -0400
commitb34a6b1da371ed8af1221459a18c67970f7e3d53 (patch)
tree5addc850de13623b172395b9d0d7d670930fa6b3 /Documentation/sysctl
parentd40dcdb0172a1ba853464983a059fb45e0aaf61a (diff)
ipc: introduce shm_rmid_forced sysctl
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 <segoon@openwall.com> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "Serge E. Hallyn" <serge.hallyn@canonical.com> Cc: Daniel Lezcano <daniel.lezcano@free.fr> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Solar Designer <solar@openwall.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/sysctl')
-rw-r--r--Documentation/sysctl/kernel.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 1c7fb0a94e28..704e474a93df 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -61,6 +61,7 @@ show up in /proc/sys/kernel:
61- rtsig-nr 61- rtsig-nr
62- sem 62- sem
63- sg-big-buff [ generic SCSI device (sg) ] 63- sg-big-buff [ generic SCSI device (sg) ]
64- shm_rmid_forced
64- shmall 65- shmall
65- shmmax [ sysv ipc ] 66- shmmax [ sysv ipc ]
66- shmmni 67- shmmni
@@ -518,6 +519,27 @@ kernel. This value defaults to SHMMAX.
518 519
519============================================================== 520==============================================================
520 521
522shm_rmid_forced:
523
524Linux lets you set resource limits, including how much memory one
525process can consume, via setrlimit(2). Unfortunately, shared memory
526segments are allowed to exist without association with any process, and
527thus might not be counted against any resource limits. If enabled,
528shared memory segments are automatically destroyed when their attach
529count becomes zero after a detach or a process termination. It will
530also destroy segments that were created, but never attached to, on exit
531from the process. The only use left for IPC_RMID is to immediately
532destroy an unattached segment. Of course, this breaks the way things are
533defined, so some applications might stop working. Note that this
534feature will do you no good unless you also configure your resource
535limits (in particular, RLIMIT_AS and RLIMIT_NPROC). Most systems don't
536need this.
537
538Note that if you change this from 0 to 1, already created segments
539without users and with a dead originative process will be destroyed.
540
541==============================================================
542
521softlockup_thresh: 543softlockup_thresh:
522 544
523This value can be used to lower the softlockup tolerance threshold. The 545This value can be used to lower the softlockup tolerance threshold. The