summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-09-25 23:31:29 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:48 -0700
commit7887a3da753e1ba8244556cc9a2b38c815bfe256 (patch)
treef3563927615c6b9c260f7ca84567c7bca2dac91f /mm
parent4ff1ffb4870b007b86f21e5f27eeb11498c4c077 (diff)
downloadop-kernel-dev-7887a3da753e1ba8244556cc9a2b38c815bfe256.zip
op-kernel-dev-7887a3da753e1ba8244556cc9a2b38c815bfe256.tar.gz
[PATCH] oom: cpuset hint
cpuset_excl_nodes_overlap does not always indicate that killing a task will not free any memory we for us. For example, we may be asking for an allocation from _anywhere_ in the machine, or the task in question may be pinning memory that is outside its cpuset. Fix this by just causing cpuset_excl_nodes_overlap to reduce the badness rather than disallow it. Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-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')
-rw-r--r--mm/oom_kill.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 7d05684..4f815b0 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -129,6 +129,14 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
points /= 4;
/*
+ * If p's nodes don't overlap ours, it may still help to kill p
+ * because p may have allocated or otherwise mapped memory on
+ * this node before. However it will be less likely.
+ */
+ if (!cpuset_excl_nodes_overlap(p))
+ points /= 8;
+
+ /*
* Adjust the score by oomkilladj.
*/
if (p->oomkilladj) {
@@ -198,9 +206,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
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 wait for it
OpenPOWER on IntegriCloud