lkml.org 
[lkml]   [2007]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sysctl_panic_on_oom broken
From
Date
On Tue, 2007-04-17 at 14:39 -0700, Christoph Lameter wrote:

>
> It recreates the old problem that we OOM while we still have memory
> in other parts of the system.

How, by the time we get here we have already decided we are going to
OOMkill or panic. This change just obeys sysctl_panic_on_oom before
killing current.

-----------------------------------------------------------------------
/* check if we are going to panic before enything else... */
if (sysctl_panic_on_oom)
panic("out of memory. panic_on_oom is selected\n");
/*
* Check if there were limitations on the allocation
* NUMA) that may require different handling.
*/
switch (constrained_alloc(zonelist, gfp_mask)) {
case CONSTRAINT_MEMORY_POLICY:
oom_kill_process(current, points,
"No available memory (MPOL_BIND)");
break;
case CONSTRAINT_CPUSET:
oom_kill_process(current, points,
"No available memory in cpuset");
break;

case CONSTRAINT_NONE:
retry:
/*
* Rambo mode: Shoot down a process and hope
* issues we may have.
*/
p = select_bad_process(&points);
if (PTR_ERR(p) == -1UL)
goto out;
/* Found nothing?!?! Either we hang or we panic. */

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

\
 
 \ /
  Last update: 2007-04-18 03:27    [from the cache]
©2003-2011 Jasper Spaans