linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use oom_killer_disabled in all oom pathes
@ 2011-04-26  2:54 Dave Young
  2011-04-26  2:57 ` KOSAKI Motohiro
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Young @ 2011-04-26  2:54 UTC (permalink / raw)
  To: linux-mm, linux-kernel

oom_killer_disable should be a global switch, also fit for oom paths
other than __alloc_pages_slowpath 

Here add it to mem_cgroup_handle_oom and pagefault_out_of_memory as well.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
 mm/memcontrol.c |    2 +-
 mm/oom_kill.c   |    3 +++

 2 files changed, 4 insertions(+), 1 deletion(-)
--- linux-2.6.orig/mm/memcontrol.c	2011-04-20 15:49:10.336660690 +0800
+++ linux-2.6/mm/memcontrol.c	2011-04-26 10:41:04.746459757 +0800
@@ -1610,7 +1610,7 @@ bool mem_cgroup_handle_oom(struct mem_cg
 	 * under OOM is always welcomed, use TASK_KILLABLE here.
 	 */
 	prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
-	if (!locked || mem->oom_kill_disable)
+	if (!locked || mem->oom_kill_disable || oom_killer_disabled)
 		need_to_kill = false;
 	if (locked)
 		mem_cgroup_oom_notify(mem);
--- linux-2.6.orig/mm/oom_kill.c	2011-04-20 15:49:10.353327356 +0800
+++ linux-2.6/mm/oom_kill.c	2011-04-26 10:41:04.753126423 +0800
@@ -747,6 +747,9 @@ out:
  */
 void pagefault_out_of_memory(void)
 {
+	if (oom_killer_disabled)
+		return;
+
 	if (try_set_system_oom()) {
 		out_of_memory(NULL, 0, 0, NULL);
 		clear_system_oom();

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-04-26  3:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26  2:54 [PATCH] use oom_killer_disabled in all oom pathes Dave Young
2011-04-26  2:57 ` KOSAKI Motohiro
2011-04-26  3:05   ` Dave Young
2011-04-26  3:14     ` KOSAKI Motohiro
2011-04-26  3:19       ` Dave Young
2011-04-26  3:17         ` KAMEZAWA Hiroyuki
2011-04-26  3:26           ` Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).