* sysctl_panic_on_oom broken
@ 2007-04-17 18:15 Larry Woodman
2007-04-17 21:27 ` Christoph Lameter
0 siblings, 1 reply; 2+ messages in thread
From: Larry Woodman @ 2007-04-17 18:15 UTC (permalink / raw)
To: linux-mm
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
out_of_memory() does not panic when sysctl_panic_on_oom is set
if constrained_alloc() does not return CONSTRAINT_NONE. Instead,
out_of_memory() kills the current process whenever constrained_alloc()
returns either CONSTRAINT_MEMORY_POLICY or CONSTRAINT_CPUSET.
This patch fixes this problem:
[-- Attachment #2: panic_on_oom.patch --]
[-- Type: text/plain, Size: 724 bytes --]
--- linux-2.6.18.noarch/mm/oom_kill.c.orig
+++ linux-2.6.18.noarch/mm/oom_kill.c
@@ -431,6 +437,9 @@ void out_of_memory(struct zonelist *zone
cpuset_lock();
read_lock(&tasklist_lock);
+ /* 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 (only relevant for
* NUMA) that may require different handling.
@@ -447,8 +456,6 @@ void out_of_memory(struct zonelist *zone
break;
case CONSTRAINT_NONE:
- if (sysctl_panic_on_oom)
- panic("out of memory. panic_on_oom is selected\n");
retry:
/*
* Rambo mode: Shoot down a process and hope it solves whatever
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: sysctl_panic_on_oom broken
2007-04-17 18:15 sysctl_panic_on_oom broken Larry Woodman
@ 2007-04-17 21:27 ` Christoph Lameter
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Lameter @ 2007-04-17 21:27 UTC (permalink / raw)
To: Larry Woodman; +Cc: linux-mm
On Tue, 17 Apr 2007, Larry Woodman wrote:
> out_of_memory() does not panic when sysctl_panic_on_oom is set
> if constrained_alloc() does not return CONSTRAINT_NONE. Instead,
> out_of_memory() kills the current process whenever constrained_alloc()
> returns either CONSTRAINT_MEMORY_POLICY or CONSTRAINT_CPUSET.
> This patch fixes this problem:
The patch recreates the problem that the system may OOM
although lots of memory is still free. Constrained allocation means that
the allocation was only to a portion of system memory. The rest may be
free. No reason to oom.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-17 21:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-17 18:15 sysctl_panic_on_oom broken Larry Woodman
2007-04-17 21:27 ` Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox