aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Handa <[email protected]>2016-03-17 14:20:48 -0700
committerLinus Torvalds <[email protected]>2016-03-17 15:09:34 -0700
commit0a687aace3b8e215e08eed8a67014f5b8f133ab0 (patch)
treeb81d0496ee8ccf3060566c57feb0f77a6394aa57
parent6afcf2895e6f229476bd0dc95fe915e639ae0a49 (diff)
mm,oom: do not loop !__GFP_FS allocation if the OOM killer is disabled
After the OOM killer is disabled during suspend operation, any !__GFP_NOFAIL && __GFP_FS allocations are forced to fail. Thus, any !__GFP_NOFAIL && !__GFP_FS allocations should be forced to fail as well. Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/page_alloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3583f7195d5b..a762be57e46e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2858,8 +2858,12 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
* XXX: Page reclaim didn't yield anything,
* and the OOM killer can't be invoked, but
* keep looping as per tradition.
+ *
+ * But do not keep looping if oom_killer_disable()
+ * was already called, for the system is trying to
+ * enter a quiescent state during suspend.
*/
- *did_some_progress = 1;
+ *did_some_progress = !oom_killer_disabled;
goto out;
}
if (pm_suspended_storage())