Bug 583999

Summary: [RFE] Add upstream OOM Killer enhancements (eg. /proc/sys/vm/oom_kill_allocating_task)
Product: Red Hat Enterprise Linux 5 Reporter: Matthias Kranz <mkranz>
Component: kernelAssignee: mm-maint-bot <mm-maint>
kernel sub component: Memory Management QA Contact: Red Hat Kernel QE team <kernel-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: low CC: pm-rhel, sghosh
Version: 5.7   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-03 12:28:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthias Kranz 2010-04-20 13:25:40 UTC
Description of problem:

Under some circumstances the current RHEL5 implementation of the OOM
killer does not work out very well, e.g. because it needs to scan the
whole task list before it can make its decision to kill a process, based
on the defined heuristics.

In upstream kernel 2.6.24, some additional functionality was
implemented, including

/proc/sys/vm/oom_kill_allocating_task

See also http://lwn.net/Articles/254559/

This enables or disables killing the OOM-triggering task in
out-of-memory situations.

If this is set to zero, the OOM killer will scan through the entire
tasklist and select a task based on heuristics to kill.  This normally
selects a rogue memory-hogging task that frees up a large amount of
memory when killed.

If this is set to non-zero, the OOM killer simply kills the task that
triggered the out-of-memory condition.  This avoids the expensive
tasklist scan.

If panic_on_oom is selected, it takes precedence over whatever value
is used in oom_kill_allocating_task.

The default value is 0.

The following test program might be helpful:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define N       100000

int main (void) {
        int i, n = 0;
        char *pp[N];

        for (n = 0; n < N; n++) {
                pp[n] = malloc(1<<20);
                if (pp[n] == NULL)
                        break;
        }

        printf("malloc failure after %d MiB\n", n);

        for (i = 0; i < n; i++) {
                memset (pp[i], 0, (1<<20));
                printf("got %d MiB\n", i+1);
        }

        return 0;
}

Comment 1 RHEL Program Management 2014-03-07 12:50:54 UTC
This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug.

Comment 2 RHEL Program Management 2014-06-03 12:28:34 UTC
Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support).