• Johannes Weiner's avatar
    mm: page_alloc: inline should_alloc_retry() · 9083905a
    Johannes Weiner authored
    The should_alloc_retry() function was meant to encapsulate retry
    conditions of the allocator slowpath, but there are still checks
    remaining in the main function, and much of how the retrying is
    performed also depends on the OOM killer progress.  The physical
    separation of those conditions make the code hard to follow.
    
    Inline the should_alloc_retry() checks.  Notes:
    
    - The __GFP_NOFAIL check is already done in __alloc_pages_may_oom(),
      replace it with looping on OOM killer progress
    
    - The pm_suspended_storage() check is meant to skip the OOM killer
      when reclaim has no IO available, move to __alloc_pages_may_oom()
    
    - The order <= PAGE_ALLOC_COSTLY order is re-united with its original
      counterpart of checking whether reclaim actually made any progress
    Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9083905a
page_alloc.c 182 KB