aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 042e6436c3ee..d46ed0f1dc06 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -22,10 +22,11 @@
22#include <linux/jiffies.h> 22#include <linux/jiffies.h>
23#include <linux/cpuset.h> 23#include <linux/cpuset.h>
24 24
25int sysctl_panic_on_oom;
25/* #define DEBUG */ 26/* #define DEBUG */
26 27
27/** 28/**
28 * oom_badness - calculate a numeric value for how bad this task has been 29 * badness - calculate a numeric value for how bad this task has been
29 * @p: task struct of which task we should calculate 30 * @p: task struct of which task we should calculate
30 * @uptime: current uptime in seconds 31 * @uptime: current uptime in seconds
31 * 32 *
@@ -200,7 +201,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
200 continue; 201 continue;
201 202
202 /* 203 /*
203 * This is in the process of releasing memory so for wait it 204 * This is in the process of releasing memory so wait for it
204 * to finish before killing some other task by mistake. 205 * to finish before killing some other task by mistake.
205 */ 206 */
206 releasing = test_tsk_thread_flag(p, TIF_MEMDIE) || 207 releasing = test_tsk_thread_flag(p, TIF_MEMDIE) ||
@@ -306,7 +307,7 @@ static int oom_kill_process(struct task_struct *p, unsigned long points,
306} 307}
307 308
308/** 309/**
309 * oom_kill - kill the "best" process when we run out of memory 310 * out_of_memory - kill the "best" process when we run out of memory
310 * 311 *
311 * If we run out of memory, we have the choice between either 312 * If we run out of memory, we have the choice between either
312 * killing a random task (bad), letting the system crash (worse) 313 * killing a random task (bad), letting the system crash (worse)
@@ -344,6 +345,8 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
344 break; 345 break;
345 346
346 case CONSTRAINT_NONE: 347 case CONSTRAINT_NONE:
348 if (sysctl_panic_on_oom)
349 panic("out of memory. panic_on_oom is selected\n");
347retry: 350retry:
348 /* 351 /*
349 * Rambo mode: Shoot down a process and hope it solves whatever 352 * Rambo mode: Shoot down a process and hope it solves whatever