summaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-05-12 11:57:09 +0200
committerTakashi Iwai <tiwai@suse.de>2009-05-12 11:57:09 +0200
commitddc4097b77bbb227851a44287acb2fb8a9896cc1 (patch)
tree319d098879bed7c45543d983de8becd509701b22 /mm/oom_kill.c
parentbec4c99e8637b5b8bd4b0513eacb51da25885e3b (diff)
parentae31c1fbdbb18d917b0a1139497c2dbd35886989 (diff)
downloadop-kernel-dev-ddc4097b77bbb227851a44287acb2fb8a9896cc1.zip
op-kernel-dev-ddc4097b77bbb227851a44287acb2fb8a9896cc1.tar.gz
Merge branch 'topic/drvdata-fix' into topic/asoc
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2f3166e..92bcf1d 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -514,34 +514,32 @@ void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask)
*/
static void __out_of_memory(gfp_t gfp_mask, int order)
{
- if (sysctl_oom_kill_allocating_task) {
- oom_kill_process(current, gfp_mask, order, 0, NULL,
- "Out of memory (oom_kill_allocating_task)");
-
- } else {
- unsigned long points;
- struct task_struct *p;
-
-retry:
- /*
- * Rambo mode: Shoot down a process and hope it solves whatever
- * issues we may have.
- */
- p = select_bad_process(&points, NULL);
+ struct task_struct *p;
+ unsigned long points;
- if (PTR_ERR(p) == -1UL)
+ if (sysctl_oom_kill_allocating_task)
+ if (!oom_kill_process(current, gfp_mask, order, 0, NULL,
+ "Out of memory (oom_kill_allocating_task)"))
return;
+retry:
+ /*
+ * Rambo mode: Shoot down a process and hope it solves whatever
+ * issues we may have.
+ */
+ p = select_bad_process(&points, NULL);
- /* Found nothing?!?! Either we hang forever, or we panic. */
- if (!p) {
- read_unlock(&tasklist_lock);
- panic("Out of memory and no killable processes...\n");
- }
+ if (PTR_ERR(p) == -1UL)
+ return;
- if (oom_kill_process(p, gfp_mask, order, points, NULL,
- "Out of memory"))
- goto retry;
+ /* Found nothing?!?! Either we hang forever, or we panic. */
+ if (!p) {
+ read_unlock(&tasklist_lock);
+ panic("Out of memory and no killable processes...\n");
}
+
+ if (oom_kill_process(p, gfp_mask, order, points, NULL,
+ "Out of memory"))
+ goto retry;
}
/*
OpenPOWER on IntegriCloud