linux/Documentation/filesystems
David Rientjes 778c14affa mm, oom: base root bonus on current usage
A 3% of system memory bonus is sometimes too excessive in comparison to
other processes.

With commit a63d83f427 ("oom: badness heuristic rewrite"), the OOM
killer tries to avoid killing privileged tasks by subtracting 3% of
overall memory (system or cgroup) from their per-task consumption.  But
as a result, all root tasks that consume less than 3% of overall memory
are considered equal, and so it only takes 33+ privileged tasks pushing
the system out of memory for the OOM killer to do something stupid and
kill dhclient or other root-owned processes.  For example, on a 32G
machine it can't tell the difference between the 1M agetty and the 10G
fork bomb member.

The changelog describes this 3% boost as the equivalent to the global
overcommit limit being 3% higher for privileged tasks, but this is not
the same as discounting 3% of overall memory from _every privileged task
individually_ during OOM selection.

Replace the 3% of system memory bonus with a 3% of current memory usage
bonus.

By giving root tasks a bonus that is proportional to their actual size,
they remain comparable even when relatively small.  In the example
above, the OOM killer will discount the 1M agetty's 256 badness points
down to 179, and the 10G fork bomb's 262144 points down to 183500 points
and make the right choice, instead of discounting both to 0 and killing
agetty because it's first in the task list.

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-30 16:56:56 -08:00
..
caching FS-Cache: Provide the ability to enable/disable cookies 2013-09-27 18:40:25 +01:00
cifs cifs: update cifs.txt and remove some outdated infos 2013-09-13 16:29:58 -05:00
configfs
nfs nfsd4: update 4.1 nfsd status documentation 2013-12-10 20:35:57 -05:00
pohmelfs
00-INDEX Documentation/filesystems/00-INDEX: updates 2014-01-23 16:37:01 -08:00
9p.txt 9p: update documentation 2014-01-24 10:55:21 -06:00
adfs.txt
affs.txt
afs.txt
autofs4-mount-control.txt
automount-support.txt
befs.txt Documentation: befs.txt: no maintainer, orphaned 2011-08-13 18:34:03 -07:00
bfs.txt remove mention of CONFIG_KMOD from documentation 2008-07-22 19:24:29 +10:00
btrfs.txt Documentation: filesystems: update btrfs tools section 2013-11-21 11:51:50 -05:00
ceph.txt
coda.txt
cramfs.txt
debugfs.txt debugfs: more tightly restrict default mount mode 2012-08-27 13:42:02 -07:00
devpts.txt
directory-locking vfs: take i_mutex on renamed file 2013-11-09 00:16:40 -05:00
dlmfs.txt
dnotify.txt
dnotify_test.c
ecryptfs.txt
efivarfs.txt efivarfs: Add documentation for the EFI variable filesystem 2012-10-30 10:39:18 +00:00
exofs.txt
ext2.txt
ext3.txt ext3: allow specifying external journal by pathname mount option 2013-07-31 22:11:15 +02:00
ext4.txt Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-09-06 09:36:28 -07:00
f2fs.txt f2fs: update documents and a MAINTAINERS entry 2014-01-09 21:00:06 +09:00
fiemap.txt
files.txt
fuse.txt
gfs2-glocks.txt
gfs2-uevents.txt
gfs2.txt
hfs.txt
hfsplus.txt
hpfs.txt
inotify.txt
isofs.txt
jfs.txt doc: fix misspellings with 'codespell' tool 2013-05-28 12:02:12 +02:00
Locking doc: Fix typo (acces_process_vm -> access_process_vm) 2013-12-19 15:12:21 +01:00
locks.txt
logfs.txt
Makefile
mandatory-locking.txt locks: add warning about mandatory locking races 2007-10-09 18:32:45 -04:00
ncpfs.txt
nilfs2.txt nilfs2: add comments for ioctls 2014-01-23 16:37:00 -08:00
ntfs.txt
ocfs2.txt
omfs.txt
path-lookup.txt
porting iget/iget5: don't bother with ->i_lock until we find a match 2013-11-09 00:16:31 -05:00
proc.txt mm, oom: base root bonus on current usage 2014-01-30 16:56:56 -08:00
qnx6.txt doc: filesystems : Fix typo in Documentations/filesystems 2013-08-20 13:45:56 +02:00
quota.txt quota: documentation for sending "below quota" messages via netlink and tiny doc update 2008-08-12 16:07:27 -07:00
ramfs-rootfs-initramfs.txt initmpfs: use initramfs if rootfstype= or root= specified 2013-09-11 15:59:38 -07:00
relay.txt doc: Fix typo in doucmentations 2013-07-25 12:34:15 +02:00
romfs.txt
seq_file.txt
sharedsubtree.txt
spufs.txt
squashfs.txt
sysfs-pci.txt
sysfs-tagging.txt doc: Fix typo in doucmentations 2013-07-25 12:34:15 +02:00
sysfs.txt Documentation/filesystems/sysfs.txt: fix device_attribute declaration 2014-01-23 16:37:00 -08:00
sysv-fs.txt
tmpfs.txt
ubifs.txt
udf.txt udf: implement mode and dmode mounting options 2009-04-02 12:29:50 +02:00
ufs.txt
vfat.txt Documentation/filesystems/vfat.txt: fix directory entry example 2013-11-13 12:09:32 +09:00
vfs.txt vfs: improve i_op->atomic_open() documentation 2013-09-16 19:17:24 -04:00
xfs-delayed-logging-design.txt
xfs-self-describing-metadata.txt xfs: add metadata CRC documentation 2013-04-27 13:27:43 -05:00
xfs.txt doc: filesystems : Fix typo in Documentations/filesystems 2013-08-20 13:45:56 +02:00
xip.txt DOC: update xip method info 2008-11-12 17:17:17 -08:00