diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2006-06-23 05:03:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:42:47 -0400 |
commit | fadd8fbd153c12963f8fe3c9ef7f8967f286f98b (patch) | |
tree | 547cdee6203b769773521118a4dd19e95a7ef3fd /kernel | |
parent | 67de648211fa041fe08a0c25241a4980bbb90698 (diff) |
[PATCH] support for panic at OOM
This patch adds panic_on_oom sysctl under sys.vm.
When sysctl vm.panic_on_oom = 1, the kernel panics intead of killing rogue
processes. And if vm.panic_on_oom is 0 the kernel will do oom_kill() in
the same way as it does today. Of course, the default value is 0 and only
root can modifies it.
In general, oom_killer works well and kill rogue processes. So the whole
system can survive. But there are environments where panic is preferable
rather than kill some processes.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-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 0d656e61621d..072ac446810a 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -59,6 +59,7 @@ extern int proc_nr_files(ctl_table *table, int write, struct file *filp, | |||
59 | extern int C_A_D; | 59 | extern int C_A_D; |
60 | extern int sysctl_overcommit_memory; | 60 | extern int sysctl_overcommit_memory; |
61 | extern int sysctl_overcommit_ratio; | 61 | extern int sysctl_overcommit_ratio; |
62 | extern int sysctl_panic_on_oom; | ||
62 | extern int max_threads; | 63 | extern int max_threads; |
63 | extern int sysrq_enabled; | 64 | extern int sysrq_enabled; |
64 | extern int core_uses_pid; | 65 | extern int core_uses_pid; |
@@ -702,6 +703,14 @@ static ctl_table vm_table[] = { | |||
702 | .proc_handler = &proc_dointvec, | 703 | .proc_handler = &proc_dointvec, |
703 | }, | 704 | }, |
704 | { | 705 | { |
706 | .ctl_name = VM_PANIC_ON_OOM, | ||
707 | .procname = "panic_on_oom", | ||
708 | .data = &sysctl_panic_on_oom, | ||
709 | .maxlen = sizeof(sysctl_panic_on_oom), | ||
710 | .mode = 0644, | ||
711 | .proc_handler = &proc_dointvec, | ||
712 | }, | ||
713 | { | ||
705 | .ctl_name = VM_OVERCOMMIT_RATIO, | 714 | .ctl_name = VM_OVERCOMMIT_RATIO, |
706 | .procname = "overcommit_ratio", | 715 | .procname = "overcommit_ratio", |
707 | .data = &sysctl_overcommit_ratio, | 716 | .data = &sysctl_overcommit_ratio, |