[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>
This commit is contained in:

committed by
Linus Torvalds

parent
9bf2229f88
commit
ef08e3b498
@@ -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.
|
||||
|
Reference in New Issue
Block a user