[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100114191940.6749.A69D9226@jp.fujitsu.com>
Date: Thu, 14 Jan 2010 19:22:34 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Nick Piggin <npiggin@...e.de>, Jeff Dike <jdike@...toit.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Cc: kosaki.motohiro@...fujitsu.com
Subject: [PATCH] oom: OOM-Killed process don't invoke pagefault-oom
Nick, I've found this issue by code review. I'm glad if you review this
patch.
Thanks.
=============================
commit 1c0fe6e3 (invoke oom-killer from page fault) created
page fault specific oom handler.
But If OOM occur, alloc_pages() in page fault might return
NULL. It mean page fault return VM_FAULT_OOM. But OOM Killer
itself sholdn't invoke next OOM Kill. it is obviously strange.
Plus, process exiting itself makes some free memory. we
don't need kill another process.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: Nick Piggin <npiggin@...e.de>
Cc: Jeff Dike <jdike@...toit.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
mm/oom_kill.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 4f167b8..86cecdf 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -596,6 +596,15 @@ void pagefault_out_of_memory(void)
{
unsigned long freed = 0;
+ /*
+ * If the task was received SIGKILL while memory allocation, alloc_pages
+ * might return NULL and it cause page fault return VM_FAULT_OOM. But
+ * in such case, the task don't need kill any another task, it need
+ * just die.
+ */
+ if (fatal_signal_pending(current))
+ return;
+
blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
if (freed > 0)
/* Got some memory back in the last second. */
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists