Skip to content

Commit

Permalink
allow oom_adj of saintly processes
Browse files Browse the repository at this point in the history
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 <jpritikin@pobox.com>
Cc: Andrea Arcangeli <andrea@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Joshua N Pritikin authored and Linus Torvalds committed May 7, 2007
1 parent 3d67f2d commit 9a82782
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 9a82782

Please sign in to comment.