diff options
author | David Rientjes <rientjes@google.com> | 2007-10-17 02:25:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:46 -0400 |
commit | fe071d7e8aae5745c009c808bb8933f22a9e305a (patch) | |
tree | 757dc7c41a7b56974c383743103fb711c976c288 /kernel/sysctl.c | |
parent | ff0ceb9deb6eb017f52900b708d49cfa77bf25fb (diff) |
oom: add oom_kill_allocating_task sysctl
Adds a new sysctl, 'oom_kill_allocating_task', which will automatically kill
the OOM-triggering task instead of scanning through the tasklist to find a
memory-hogging target. This is helpful for systems with an insanely large
number of tasks where scanning the tasklist significantly degrades
performance.
Cc: Andrea Arcangeli <andrea@suse.de>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index c676b5ec88f5..5e63de0f9ee2 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -63,6 +63,7 @@ extern int print_fatal_signals; | |||
63 | extern int sysctl_overcommit_memory; | 63 | extern int sysctl_overcommit_memory; |
64 | extern int sysctl_overcommit_ratio; | 64 | extern int sysctl_overcommit_ratio; |
65 | extern int sysctl_panic_on_oom; | 65 | extern int sysctl_panic_on_oom; |
66 | extern int sysctl_oom_kill_allocating_task; | ||
66 | extern int max_threads; | 67 | extern int max_threads; |
67 | extern int core_uses_pid; | 68 | extern int core_uses_pid; |
68 | extern int suid_dumpable; | 69 | extern int suid_dumpable; |
@@ -781,6 +782,14 @@ static ctl_table vm_table[] = { | |||
781 | .proc_handler = &proc_dointvec, | 782 | .proc_handler = &proc_dointvec, |
782 | }, | 783 | }, |
783 | { | 784 | { |
785 | .ctl_name = CTL_UNNUMBERED, | ||
786 | .procname = "oom_kill_allocating_task", | ||
787 | .data = &sysctl_oom_kill_allocating_task, | ||
788 | .maxlen = sizeof(sysctl_oom_kill_allocating_task), | ||
789 | .mode = 0644, | ||
790 | .proc_handler = &proc_dointvec, | ||
791 | }, | ||
792 | { | ||
784 | .ctl_name = VM_OVERCOMMIT_RATIO, | 793 | .ctl_name = VM_OVERCOMMIT_RATIO, |
785 | .procname = "overcommit_ratio", | 794 | .procname = "overcommit_ratio", |
786 | .data = &sysctl_overcommit_ratio, | 795 | .data = &sysctl_overcommit_ratio, |