]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - mm/oom_kill.c
[PATCH] cpusets: confine oom_killer to mem_exclusive cpuset
[net-next-2.6.git] / mm / oom_kill.c
index 3a1d46502938eaf7b5c03216a3f21a53e4d54deb..5ec8da12cfd986523bb1968ffa9f2ea0be064868 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/swap.h>
 #include <linux/timex.h>
 #include <linux/jiffies.h>
+#include <linux/cpuset.h>
 
 /* #define DEBUG */
 
@@ -152,6 +153,10 @@ static struct task_struct * select_bad_process(void)
                        continue;
                if (p->oomkilladj == OOM_DISABLE)
                        continue;
+               /* If p's nodes don't overlap ours, it won't help to kill p. */
+               if (!cpuset_excl_nodes_overlap(p))
+                       continue;
+
                /*
                 * This is in the process of releasing memory so for wait it
                 * to finish before killing some other task by mistake.