提交 9a82782f 编写于 作者: J Joshua N Pritikin 提交者: 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: NJoshua N. Pritikin <jpritikin@pobox.com>
Cc: Andrea Arcangeli <andrea@novell.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册