Suspend 2 merge:L 12/51: Disable OOM killer when suspending.

From: Nigel Cunningham
Date: Wed Nov 24 2004 - 11:52:36 EST


When preparing the image, suspend eats all the memory in sight, both to
reduce the image size and to improve the reliability of our stats (We've
worked hard to make it work reliably under heavy load - 100+). Of course
this can result in the OOM killer being triggered, so this simple test
stops that happening.

diff -ruN 501-disable-oom-killer-when-suspending-old/mm/oom_kill.c 501-disable-oom-killer-when-suspending-new/mm/oom_kill.c
--- 501-disable-oom-killer-when-suspending-old/mm/oom_kill.c 2004-11-03 21:53:47.000000000 +1100
+++ 501-disable-oom-killer-when-suspending-new/mm/oom_kill.c 2004-11-04 16:27:40.000000000 +1100
@@ -20,6 +20,7 @@
#include <linux/swap.h>
#include <linux/timex.h>
#include <linux/jiffies.h>
+#include <linux/suspend.h>

/* #define DEBUG */

@@ -237,6 +238,9 @@
static unsigned long first, last, count, lastkill;
unsigned long now, since;

+ if (test_suspend_state(SUSPEND_FREEZER_ON))
+ return;
+
spin_lock(&oom_lock);
now = jiffies;
since = now - last;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/