提交 af5b9124 编写于 作者: N Nick Piggin 提交者: Linus Torvalds

[PATCH] oom: swapoff tasks tweak

PF_SWAPOFF processes currently cause select_bad_process to return straight
away.  Instead, give them high priority, so we will kill them first, however
we also first ensure no parallel OOM kills are happening at the same time.
Signed-off-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 4a3ede10
......@@ -59,6 +59,12 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
return 0;
}
/*
* swapoff can easily use up all memory, so kill those first.
*/
if (p->flags & PF_SWAPOFF)
return ULONG_MAX;
/*
* The memory size of the process is the basis for the badness.
*/
......@@ -230,8 +236,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
}
if (p->oomkilladj == OOM_DISABLE)
continue;
if (p->flags & PF_SWAPOFF)
return p;
points = badness(p, uptime.tv_sec);
if (points > *ppoints || !chosen) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册