Commit 9a82782f authored by Joshua N Pritikin's avatar Joshua N Pritikin Committed by Linus Torvalds

allow oom_adj of saintly processes

If the badness of a process is zero then oom_adj>0 has no effect.  This
patch makes sure that the oom_adj shift actually increases badness points
appropriately.
Signed-off-by: default avatarJoshua N. Pritikin <jpritikin@pobox.com>
Cc: Andrea Arcangeli <andrea@novell.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d67f2d7
...@@ -147,9 +147,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) ...@@ -147,9 +147,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
* Adjust the score by oomkilladj. * Adjust the score by oomkilladj.
*/ */
if (p->oomkilladj) { if (p->oomkilladj) {
if (p->oomkilladj > 0) if (p->oomkilladj > 0) {
if (!points)
points = 1;
points <<= p->oomkilladj; points <<= p->oomkilladj;
else } else
points >>= -(p->oomkilladj); points >>= -(p->oomkilladj);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment