android_kernel_samsung_msm8976/Documentation/filesystems
David Rientjes 06bdd77c70 mm, oom: base root bonus on current usage
commit 778c14affaf94a9e4953179d3e13a544ccce7707 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-13 13:48:02 -08:00
..
caching FS-Cache: Provide proper invalidation 2012-12-20 22:04:07 +00:00
configfs
nfs SUNRPC: Use gssproxy upcall for server RPCGSS authentication. 2013-04-26 11:41:28 -04:00
pohmelfs Documentation: Fix multiple typo in Documentation 2012-03-07 16:08:24 +01:00
00-INDEX Introduce a new file system, Flash-Friendly File System (F2FS), to Linux 3.8. 2012-12-20 13:54:52 -08:00
9p.txt
Locking vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
Makefile
adfs.txt
affs.txt
afs.txt
autofs4-mount-control.txt
automount-support.txt
befs.txt
bfs.txt
btrfs.txt btrfs: document mount options in Documentation/fs/btrfs.txt 2013-05-06 15:54:26 -04:00
ceph.txt
cifs.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
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: update documentation with barrier=1 default 2012-04-11 11:12:45 +02:00
ext4.txt ext4: introduce reserved space 2013-04-09 22:11:22 -04:00
f2fs.txt f2fs: update f2fs.txt related with discard at mkfs 2013-04-03 17:27:52 +09:00
fiemap.txt
files.txt Wrap accesses to the fd_sets in struct fdtable 2012-02-19 10:30:52 -08:00
fuse.txt
gfs2-glocks.txt GFS2: Update glock doc to add new stats info 2012-05-10 12:41:40 +01:00
gfs2-uevents.txt Documentation: Fix multiple typo in Documentation 2012-03-07 16:08:24 +01:00
gfs2.txt GFS2: Update main gfs2 doc 2012-05-10 11:45:31 +01:00
hfs.txt
hfsplus.txt
hpfs.txt
inotify.txt
isofs.txt
jfs.txt jfs: Remove obsolete email address 2012-09-17 12:00:01 -05:00
locks.txt
logfs.txt
mandatory-locking.txt
ncpfs.txt
nilfs2.txt
ntfs.txt
ocfs2.txt
omfs.txt
path-lookup.txt
porting vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05:00
proc.txt mm, oom: base root bonus on current usage 2014-02-13 13:48:02 -08:00
qnx6.txt Documentation: Fix typo in multiple files in Documentation 2012-04-16 14:37:13 +02:00
quota.txt
ramfs-rootfs-initramfs.txt Documentation: Fix Broken URL "freshmeat" 2012-02-21 11:43:45 +01:00
relay.txt
romfs.txt
seq_file.txt
sharedsubtree.txt
spufs.txt
squashfs.txt
sysfs-pci.txt
sysfs-tagging.txt
sysfs.txt
sysv-fs.txt
tmpfs.txt
ubifs.txt
udf.txt
ufs.txt
vfat.txt Documentation: update nfs option in filesystem/vfat.txt 2013-04-29 18:28:41 -07:00
vfs.txt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op 2013-02-26 02:46:09 -05: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 xfs: disable noattr2/attr2 mount options for CRC enabled filesystems 2013-06-06 10:51:34 -05:00
xip.txt