|
@@ -333,12 +333,20 @@ static int oom_kill_task(struct task_struct *p)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int oom_kill_process(struct task_struct *p, unsigned long points,
|
|
|
|
- const char *message)
|
|
|
|
|
|
+static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
|
|
|
|
+ unsigned long points, const char *message)
|
|
{
|
|
{
|
|
struct task_struct *c;
|
|
struct task_struct *c;
|
|
struct list_head *tsk;
|
|
struct list_head *tsk;
|
|
|
|
|
|
|
|
+ if (printk_ratelimit()) {
|
|
|
|
+ printk(KERN_WARNING "%s invoked oom-killer: "
|
|
|
|
+ "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
|
|
|
|
+ current->comm, gfp_mask, order, current->oomkilladj);
|
|
|
|
+ dump_stack();
|
|
|
|
+ show_mem();
|
|
|
|
+ }
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* If the task is already exiting, don't alarm the sysadmin or kill
|
|
* If the task is already exiting, don't alarm the sysadmin or kill
|
|
* its children or threads, just set TIF_MEMDIE so it can die quickly
|
|
* its children or threads, just set TIF_MEMDIE so it can die quickly
|
|
@@ -447,14 +455,6 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
|
|
/* Got some memory back in the last second. */
|
|
/* Got some memory back in the last second. */
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (printk_ratelimit()) {
|
|
|
|
- printk(KERN_WARNING "%s invoked oom-killer: "
|
|
|
|
- "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
|
|
|
|
- current->comm, gfp_mask, order, current->oomkilladj);
|
|
|
|
- dump_stack();
|
|
|
|
- show_mem();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (sysctl_panic_on_oom == 2)
|
|
if (sysctl_panic_on_oom == 2)
|
|
panic("out of memory. Compulsory panic_on_oom is selected.\n");
|
|
panic("out of memory. Compulsory panic_on_oom is selected.\n");
|
|
|
|
|
|
@@ -468,7 +468,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
|
|
|
|
|
|
switch (constraint) {
|
|
switch (constraint) {
|
|
case CONSTRAINT_MEMORY_POLICY:
|
|
case CONSTRAINT_MEMORY_POLICY:
|
|
- oom_kill_process(current, points,
|
|
|
|
|
|
+ oom_kill_process(current, gfp_mask, order, points,
|
|
"No available memory (MPOL_BIND)");
|
|
"No available memory (MPOL_BIND)");
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -478,7 +478,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
|
|
/* Fall-through */
|
|
/* Fall-through */
|
|
case CONSTRAINT_CPUSET:
|
|
case CONSTRAINT_CPUSET:
|
|
if (sysctl_oom_kill_allocating_task) {
|
|
if (sysctl_oom_kill_allocating_task) {
|
|
- oom_kill_process(current, points,
|
|
|
|
|
|
+ oom_kill_process(current, gfp_mask, order, points,
|
|
"Out of memory (oom_kill_allocating_task)");
|
|
"Out of memory (oom_kill_allocating_task)");
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -499,7 +499,8 @@ retry:
|
|
panic("Out of memory and no killable processes...\n");
|
|
panic("Out of memory and no killable processes...\n");
|
|
}
|
|
}
|
|
|
|
|
|
- if (oom_kill_process(p, points, "Out of memory"))
|
|
|
|
|
|
+ if (oom_kill_process(p, points, gfp_mask, order,
|
|
|
|
+ "Out of memory"))
|
|
goto retry;
|
|
goto retry;
|
|
|
|
|
|
break;
|
|
break;
|