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

[PATCH] oom: handle oom_disable exiting

Having the oomkilladj == OOM_DISABLE check before the releasing check means
that oomkilladj == OOM_DISABLE tasks exiting will not stop the OOM killer.

Moving the test down will give the desired behaviour.  Also: it will allow
them to "OOM-kill" themselves if they are exiting.  As per the previous patch,
this is required to prevent OOM killer deadlocks (and they don't actually get
killed, because they're already exiting -- they're simply allowed access to
memory reserves).
Signed-off-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 50ec3bbf
...@@ -204,8 +204,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints) ...@@ -204,8 +204,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
/* skip the init task with pid == 1 */ /* skip the init task with pid == 1 */
if (p->pid == 1) if (p->pid == 1)
continue; continue;
if (p->oomkilladj == OOM_DISABLE)
continue;
/* /*
* This is in the process of releasing memory so wait for it * This is in the process of releasing memory so wait for it
...@@ -230,6 +228,8 @@ static struct task_struct *select_bad_process(unsigned long *ppoints) ...@@ -230,6 +228,8 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
} }
return ERR_PTR(-1UL); return ERR_PTR(-1UL);
} }
if (p->oomkilladj == OOM_DISABLE)
continue;
if (p->flags & PF_SWAPOFF) if (p->flags & PF_SWAPOFF)
return p; return p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册