Skip to content

Commit

Permalink
mm,oom: do not loop !__GFP_FS allocation if the OOM killer is disabled
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tetsuo Handa authored and torvalds committed Mar 17, 2016
1 parent 6afcf28 commit 0a687aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 0a687aa

Please sign in to comment.