aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2005-09-06 18:18:13 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:40 -0400
commitef08e3b4981aebf2ba9bd7025ef7210e8eec07ce (patch)
tree3b5386e011c87dde384115c8eb0d6961c2536025 /mm/oom_kill.c
parent9bf2229f8817677127a60c177aefce1badd22d7b (diff)
[PATCH] cpusets: confine oom_killer to mem_exclusive cpuset
Now the real motivation for this cpuset mem_exclusive patch series seems trivial. This patch keeps a task in or under one mem_exclusive cpuset from provoking an oom kill of a task under a non-overlapping mem_exclusive cpuset. Since only interrupt and GFP_ATOMIC allocations are allowed to escape mem_exclusive containment, there is little to gain from oom killing a task under a non-overlapping mem_exclusive cpuset, as almost all kernel and user memory allocation must come from disjoint memory nodes. This patch enables configuring a system so that a runaway job under one mem_exclusive cpuset cannot cause the killing of a job in another such cpuset that might be using very high compute and memory resources for a prolonged time. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 3a1d46502938..5ec8da12cfd9 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -20,6 +20,7 @@
20#include <linux/swap.h> 20#include <linux/swap.h>
21#include <linux/timex.h> 21#include <linux/timex.h>
22#include <linux/jiffies.h> 22#include <linux/jiffies.h>
23#include <linux/cpuset.h>
23 24
24/* #define DEBUG */ 25/* #define DEBUG */
25 26
@@ -152,6 +153,10 @@ static struct task_struct * select_bad_process(void)
152 continue; 153 continue;
153 if (p->oomkilladj == OOM_DISABLE) 154 if (p->oomkilladj == OOM_DISABLE)
154 continue; 155 continue;
156 /* If p's nodes don't overlap ours, it won't help to kill p. */
157 if (!cpuset_excl_nodes_overlap(p))
158 continue;
159
155 /* 160 /*
156 * This is in the process of releasing memory so for wait it 161 * This is in the process of releasing memory so for wait it
157 * to finish before killing some other task by mistake. 162 * to finish before killing some other task by mistake.