Re: Misleading OOM messages

From: Dave Hansen
Date: Thu May 14 2009 - 17:05:41 EST


On Thu, 2009-05-14 at 13:49 -0700, David Rientjes wrote:
> I think switching all the oom killer messages to be "no available memory"
> as it is in the MPOL_BIND case would be the best alternative. We
> currently use "out of memory" even for cpusets, for example, when it
> happens because it cannot accommodate any more hardwall allocations while
> there may be an abundance of memory elsewhere that it cannot access. I
> also think "no available memory" makes more sense than "out of memory"
> when describing situations where we're at or below the minimum watermarks
> for all allowable zones. Either that or "no allowable memory".

How about something like this to start? We can "mv mm/oom_kill.c
mm/nam_kill.c" later. ;)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 92bcf1d..0ce0d59 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -409,7 +409,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
return 0;
}

- printk(KERN_ERR "%s: kill process %d (%s) score %li or a child\n",
+ printk(KERN_ERR "No available memory %s: "
+ "kill process %d (%s) score %li or a child\n",
message, task_pid_nr(p), p->comm, points);

/* Try to kill a child first */
@@ -438,7 +439,7 @@ retry:
p = current;

if (oom_kill_process(p, gfp_mask, 0, points, mem,
- "Memory cgroup out of memory"))
+ "(memory cgroup)"))
goto retry;
out:
read_unlock(&tasklist_lock);
@@ -519,7 +520,7 @@ static void __out_of_memory(gfp_t gfp_mask, int order)

if (sysctl_oom_kill_allocating_task)
if (!oom_kill_process(current, gfp_mask, order, 0, NULL,
- "Out of memory (oom_kill_allocating_task)"))
+ "(oom_kill_allocating_task)"))
return;
retry:
/*
@@ -537,8 +538,7 @@ retry:
panic("Out of memory and no killable processes...\n");
}

- if (oom_kill_process(p, gfp_mask, order, points, NULL,
- "Out of memory"))
+ if (oom_kill_process(p, gfp_mask, order, points, NULL, ""))
goto retry;
}

@@ -612,7 +612,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
switch (constraint) {
case CONSTRAINT_MEMORY_POLICY:
oom_kill_process(current, gfp_mask, order, 0, NULL,
- "No available memory (MPOL_BIND)");
+ "(MPOL_BIND)");
break;

case CONSTRAINT_NONE:


-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/