diff options
author | David Rientjes <rientjes@google.com> | 2012-06-20 21:52:58 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-20 23:39:35 +0200 |
commit | 61eafb00d55dfbccdfce543c6b60e369ff4f8f18 (patch) | |
tree | e2be309a7412de35dd8414ea030b6650d2ea8b75 /mm/memcontrol.c | |
parent | nilfs2: ensure proper cache clearing for gc-inodes (diff) | |
download | linux-61eafb00d55dfbccdfce543c6b60e369ff4f8f18.tar.xz linux-61eafb00d55dfbccdfce543c6b60e369ff4f8f18.zip |
mm, oom: fix and cleanup oom score calculations
The divide in p->signal->oom_score_adj * totalpages / 1000 within
oom_badness() was causing an overflow of the signed long data type.
This adds both the root bias and p->signal->oom_score_adj before doing the
normalization which fixes the issue and also cleans up the calculation.
Tested-by: Dave Jones <davej@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
0 files changed, 0 insertions, 0 deletions