summaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-09-29 11:01:13 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 18:18:21 +0200
commit01017a227044d64face2588fab9427a1da1bdb9f (patch)
treeb1f369a8d20aff94447ac6acd18bbb23d268b443 /mm/oom_kill.c
parent[PATCH] select_bad_process(): cleanup 'releasing' check (diff)
downloadlinux-01017a227044d64face2588fab9427a1da1bdb9f.tar.xz
linux-01017a227044d64face2588fab9427a1da1bdb9f.zip
[PATCH] oom_kill_task(): cleanup ->mm checks
- It is not possible to have task->mm == &init_mm. - task_lock() buys nothing for 'if (!p->mm)' check. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Nick Piggin <nickpiggin@yahoo.com.au> 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.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 991bf0cf4778..a5493a3b4851 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -260,14 +260,11 @@ static void __oom_kill_task(struct task_struct *p, const char *message)
return;
}
- task_lock(p);
- if (!p->mm || p->mm == &init_mm) {
+ if (!p->mm) {
WARN_ON(1);
printk(KERN_WARNING "tried to kill an mm-less task!\n");
- task_unlock(p);
return;
}
- task_unlock(p);
if (message) {
printk(KERN_ERR "%s: Killed process %d (%s).\n",
@@ -301,7 +298,7 @@ static int oom_kill_task(struct task_struct *p, const char *message)
* However, this is of no concern to us.
*/
- if (mm == NULL || mm == &init_mm)
+ if (mm == NULL)
return 1;
__oom_kill_task(p, message);