From 1118225f83e3548669024f124e81d3ce854deff5 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 14 Mar 2011 20:05:30 +0100 Subject: [PATCH] --- yaml --- r: 234127 b: refs/heads/master c: dc1b83ab08f1954335692cdcd499f78c94f4c42a h: refs/heads/master i: 234125: 49d025271a3def7912bcc398c8367b010d5d05a1 234123: b8379aa01be1b3966e43a8184ba727fba0432770 234119: f837311c55781613f7671756257c467542e7926f 234111: eb2d3ab73b8872e530eca99c088e1e40b610f023 v: v3 --- [refs] | 2 +- trunk/mm/oom_kill.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7f3e48ae2e5b..6cdaf02c134c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5f40d4209461f23a15d88c6b55993bb8b0fa2670 +refs/heads/master: dc1b83ab08f1954335692cdcd499f78c94f4c42a diff --git a/trunk/mm/oom_kill.c b/trunk/mm/oom_kill.c index 7dcca55ede7c..b19c78eb74c0 100644 --- a/trunk/mm/oom_kill.c +++ b/trunk/mm/oom_kill.c @@ -458,10 +458,10 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, struct mem_cgroup *mem, nodemask_t *nodemask, const char *message) { - struct task_struct *victim = p; + struct task_struct *victim; struct task_struct *child; - struct task_struct *t = p; - unsigned int victim_points = 0; + struct task_struct *t; + unsigned int victim_points; if (printk_ratelimit()) dump_header(p, gfp_mask, order, mem, nodemask); @@ -487,10 +487,15 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, * parent. This attempts to lose the minimal amount of work done while * still freeing memory. */ + victim_points = oom_badness(p, mem, nodemask, totalpages); + victim = p; + t = p; do { list_for_each_entry(child, &t->children, sibling) { unsigned int child_points; + if (child->mm == t->mm) + continue; /* * oom_badness() returns 0 if the thread is unkillable */