diff options
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r-- | mm/oom_kill.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6b9e758c98a5..fd150e3a2567 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -560,6 +560,13 @@ void pagefault_out_of_memory(void) | |||
560 | /* Got some memory back in the last second. */ | 560 | /* Got some memory back in the last second. */ |
561 | return; | 561 | return; |
562 | 562 | ||
563 | /* | ||
564 | * If this is from memcg, oom-killer is already invoked. | ||
565 | * and not worth to go system-wide-oom. | ||
566 | */ | ||
567 | if (mem_cgroup_oom_called(current)) | ||
568 | goto rest_and_return; | ||
569 | |||
563 | if (sysctl_panic_on_oom) | 570 | if (sysctl_panic_on_oom) |
564 | panic("out of memory from page fault. panic_on_oom is selected.\n"); | 571 | panic("out of memory from page fault. panic_on_oom is selected.\n"); |
565 | 572 | ||
@@ -571,6 +578,7 @@ void pagefault_out_of_memory(void) | |||
571 | * Give "p" a good chance of killing itself before we | 578 | * Give "p" a good chance of killing itself before we |
572 | * retry to allocate memory. | 579 | * retry to allocate memory. |
573 | */ | 580 | */ |
581 | rest_and_return: | ||
574 | if (!test_thread_flag(TIF_MEMDIE)) | 582 | if (!test_thread_flag(TIF_MEMDIE)) |
575 | schedule_timeout_uninterruptible(1); | 583 | schedule_timeout_uninterruptible(1); |
576 | } | 584 | } |