public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oom_kill_task: cleanup ->mm checks
@ 2006-08-27 19:24 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2006-08-27 19:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Nick Piggin, linux-kernel

- 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>

--- 2.6.18-rc4/mm/oom_kill.c~	2006-08-27 22:28:42.000000000 +0400
+++ 2.6.18-rc4/mm/oom_kill.c	2006-08-27 23:09:09.000000000 +0400
@@ -262,14 +262,11 @@ static void __oom_kill_task(struct task_
 		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",
@@ -303,7 +300,7 @@ static int oom_kill_task(struct task_str
 	 * However, this is of no concern to us.
 	 */
 
-	if (mm == NULL || mm == &init_mm)
+	if (mm == NULL)
 		return 1;
 
 	__oom_kill_task(p, message);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-27 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-27 19:24 [PATCH] oom_kill_task: cleanup ->mm checks Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox