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.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2f3166e308d9..92bcf1db16b2 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)
514 */ 514 */
515static void __out_of_memory(gfp_t gfp_mask, int order) 515static void __out_of_memory(gfp_t gfp_mask, int order)
516{ 516{
517 if (sysctl_oom_kill_allocating_task) { 517 struct task_struct *p;
518 oom_kill_process(current, gfp_mask, order, 0, NULL, 518 unsigned long points;
519 "Out of memory (oom_kill_allocating_task)");
520
521 } else {
522 unsigned long points;
523 struct task_struct *p;
524
525retry:
526 /*
527 * Rambo mode: Shoot down a process and hope it solves whatever
528 * issues we may have.
529 */
530 p = select_bad_process(&points, NULL);
531 519
532 if (PTR_ERR(p) == -1UL) 520 if (sysctl_oom_kill_allocating_task)
521 if (!oom_kill_process(current, gfp_mask, order, 0, NULL,
522 "Out of memory (oom_kill_allocating_task)"))
533 return; 523 return;
524retry:
525 /*
526 * Rambo mode: Shoot down a process and hope it solves whatever
527 * issues we may have.
528 */
529 p = select_bad_process(&points, NULL);
534 530
535 /* Found nothing?!?! Either we hang forever, or we panic. */ 531 if (PTR_ERR(p) == -1UL)
536 if (!p) { 532 return;
537 read_unlock(&tasklist_lock);
538 panic("Out of memory and no killable processes...\n");
539 }
540 533
541 if (oom_kill_process(p, gfp_mask, order, points, NULL, 534 /* Found nothing?!?! Either we hang forever, or we panic. */
542 "Out of memory")) 535 if (!p) {
543 goto retry; 536 read_unlock(&tasklist_lock);
537 panic("Out of memory and no killable processes...\n");
544 } 538 }
539
540 if (oom_kill_process(p, gfp_mask, order, points, NULL,
541 "Out of memory"))
542 goto retry;
545} 543}
546 544
547/* 545/*