diff options
author | Joshua N Pritikin <jpritikin@pobox.com> | 2007-05-06 17:49:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:51 -0400 |
commit | 9a82782f8f58219d0c6dc5f0211ce301adf6c6f4 (patch) | |
tree | 0caef745a8ef3f96b3e2444d00a5180669e5c469 /mm | |
parent | 3d67f2d7c0fb28b0eb6a6aa100b190526a971ad9 (diff) |
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 <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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/oom_kill.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 3791edfffeeb..a35e7a8ebd7e 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) | |||
147 | * Adjust the score by oomkilladj. | 147 | * Adjust the score by oomkilladj. |
148 | */ | 148 | */ |
149 | if (p->oomkilladj) { | 149 | if (p->oomkilladj) { |
150 | if (p->oomkilladj > 0) | 150 | if (p->oomkilladj > 0) { |
151 | if (!points) | ||
152 | points = 1; | ||
151 | points <<= p->oomkilladj; | 153 | points <<= p->oomkilladj; |
152 | else | 154 | } else |
153 | points >>= -(p->oomkilladj); | 155 | points >>= -(p->oomkilladj); |
154 | } | 156 | } |
155 | 157 | ||