From: Joshua N Pritikin Date: Sun, 6 May 2007 21:49:07 +0000 (-0700) Subject: allow oom_adj of saintly processes X-Git-Tag: v2.6.22-rc1~989 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=9a82782f8f58219d0c6dc5f0211ce301adf6c6f4;p=powerpc.git 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: Joshua N. Pritikin Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 3791edfffe..a35e7a8ebd 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -147,9 +147,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) * Adjust the score by oomkilladj. */ if (p->oomkilladj) { - if (p->oomkilladj > 0) + if (p->oomkilladj > 0) { + if (!points) + points = 1; points <<= p->oomkilladj; - else + } else points >>= -(p->oomkilladj); }