aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-09-25 23:31:30 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:48 -0700
commit4a3ede107e422a0c53d28024b0aa902ca22a8768 (patch)
tree39f687cc0470cea45ed1387ebc16fee7d6066485 /mm/oom_kill.c
parent50ec3bbffbe8a96347c54832d48110a5bc9e9ff8 (diff)
downloadkernel_samsung_smdk4412-4a3ede107e422a0c53d28024b0aa902ca22a8768.zip
kernel_samsung_smdk4412-4a3ede107e422a0c53d28024b0aa902ca22a8768.tar.gz
kernel_samsung_smdk4412-4a3ede107e422a0c53d28024b0aa902ca22a8768.tar.bz2
[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: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 0131bae..55a05f1 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -204,8 +204,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
/* skip the init task with pid == 1 */
if (p->pid == 1)
continue;
- if (p->oomkilladj == OOM_DISABLE)
- continue;
/*
* 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)
}
return ERR_PTR(-1UL);
}
+ if (p->oomkilladj == OOM_DISABLE)
+ continue;
if (p->flags & PF_SWAPOFF)
return p;