The patch titled support for panic at OOM has been removed from the -mm tree. Its filename is support-for-panic-at-oom.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: support for panic at OOM From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- Documentation/sysctl/vm.txt | 13 +++++++++++++ include/linux/sysctl.h | 1 + kernel/sysctl.c | 9 +++++++++ mm/oom_kill.c | 3 +++ 4 files changed, 26 insertions(+) diff -puN Documentation/sysctl/vm.txt~support-for-panic-at-oom Documentation/sysctl/vm.txt --- a/Documentation/sysctl/vm.txt~support-for-panic-at-oom +++ a/Documentation/sysctl/vm.txt @@ -29,6 +29,7 @@ Currently, these files are in /proc/sys/ - drop-caches - zone_reclaim_mode - zone_reclaim_interval +- panic_on_oom ============================================================== @@ -178,3 +179,15 @@ Time is set in seconds and set by defaul Reduce the interval if undesired off node allocations occur. However, too frequent scans will have a negative impact onoff node allocation performance. +============================================================= + +panic_on_oom + +This enables or disables panic on out-of-memory feature. If this is set to 1, +the kernel panics when out-of-memory happens. If this is set to 0, the kernel +will kill some rogue process, called oom_killer. Usually, oom_killer can kill +rogue processes and system will survive. If you want to panic the system +rather than killing rogue processes, set this to 1. + +The default value is 0. + diff -puN include/linux/sysctl.h~support-for-panic-at-oom include/linux/sysctl.h --- a/include/linux/sysctl.h~support-for-panic-at-oom +++ a/include/linux/sysctl.h @@ -186,6 +186,7 @@ enum VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ + VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ }; diff -puN kernel/sysctl.c~support-for-panic-at-oom kernel/sysctl.c --- a/kernel/sysctl.c~support-for-panic-at-oom +++ a/kernel/sysctl.c @@ -59,6 +59,7 @@ extern int proc_nr_files(ctl_table *tabl extern int C_A_D; extern int sysctl_overcommit_memory; extern int sysctl_overcommit_ratio; +extern int sysctl_panic_on_oom; extern int max_threads; extern int sysrq_enabled; extern int core_uses_pid; @@ -702,6 +703,14 @@ static ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { + .ctl_name = VM_PANIC_ON_OOM, + .procname = "panic_on_oom", + .data = &sysctl_panic_on_oom, + .maxlen = sizeof(sysctl_panic_on_oom), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = VM_OVERCOMMIT_RATIO, .procname = "overcommit_ratio", .data = &sysctl_overcommit_ratio, diff -puN mm/oom_kill.c~support-for-panic-at-oom mm/oom_kill.c --- a/mm/oom_kill.c~support-for-panic-at-oom +++ a/mm/oom_kill.c @@ -22,6 +22,7 @@ #include <linux/jiffies.h> #include <linux/cpuset.h> +int sysctl_panic_on_oom; /* #define DEBUG */ /** @@ -344,6 +345,8 @@ 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 _ Patches currently in -mm which might be from kamezawa.hiroyu@xxxxxxxxxxxxxx are origin.patch acpi-memory-hotplug-cannot-manage-_crs-with-plural-resoureces.patch pgdat-allocation-for-new-node-add-generic-alloc-node_data.patch pgdat-allocation-for-new-node-add-refresh-node_data.patch pgdat-allocation-for-new-node-add-export-kswapd-start-func.patch pgdat-allocation-for-new-node-add-export-kswapd-start-func-fix.patch pgdat-allocation-for-new-node-add-call-pgdat-allocation.patch register-hot-added-memory-to-iomem-resource.patch catch-valid-mem-range-at-onlining-memory.patch node-hotplug-register-cpu-remove-node-struct.patch node-hotplug-register-cpu-remove-node-struct-alpha-fix.patch remove-empty-node-at-boot-time.patch namespaces-utsname-sysctl-hack-cleanup-2-fix.patch reiser4-hardirq-include-fix.patch genirq-rename-desc-handler-to-desc-chip-ia64-fix-2.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html