aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sysctl/vm.txt23
-rw-r--r--mm/oom_kill.c3
2 files changed, 20 insertions, 6 deletions
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index e96a341eb7e4..1d192565e182 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -197,11 +197,22 @@ and may not be fast.
197 197
198panic_on_oom 198panic_on_oom
199 199
200This enables or disables panic on out-of-memory feature. If this is set to 1, 200This enables or disables panic on out-of-memory feature.
201the kernel panics when out-of-memory happens. If this is set to 0, the kernel
202will kill some rogue process, called oom_killer. Usually, oom_killer can kill
203rogue processes and system will survive. If you want to panic the system
204rather than killing rogue processes, set this to 1.
205 201
206The default value is 0. 202If this is set to 0, the kernel will kill some rogue process,
203called oom_killer. Usually, oom_killer can kill rogue processes and
204system will survive.
205
206If this is set to 1, the kernel panics when out-of-memory happens.
207However, if a process limits using nodes by mempolicy/cpusets,
208and those nodes become memory exhaustion status, one process
209may be killed by oom-killer. No panic occurs in this case.
210Because other nodes' memory may be free. This means system total status
211may be not fatal yet.
207 212
213If this is set to 2, the kernel panics compulsorily even on the
214above-mentioned.
215
216The default value is 0.
2171 and 2 are for failover of clustering. Please select either
218according to your policy of failover.
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index a35e7a8ebd7e..038d2234f139 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -413,6 +413,9 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
413 show_mem(); 413 show_mem();
414 } 414 }
415 415
416 if (sysctl_panic_on_oom == 2)
417 panic("out of memory. Compulsory panic_on_oom is selected.\n");
418
416 cpuset_lock(); 419 cpuset_lock();
417 read_lock(&tasklist_lock); 420 read_lock(&tasklist_lock);
418 421