From: Joshua N Pritikin 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 --- mm/oom_kill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff -puN mm/oom_kill.c~allow-oom_adj-of-saintly-processes mm/oom_kill.c --- a/mm/oom_kill.c~allow-oom_adj-of-saintly-processes +++ a/mm/oom_kill.c @@ -147,9 +147,11 @@ unsigned long badness(struct task_struct * 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); } _