Re: [patch 07/12] mm: page_alloc: inline should_alloc_retry()

Johannes Weiner
2015-03-26T15:18:36Z

On Thu, Mar 26, 2015 at 03:11:28PM +0100, Michal Hocko wrote:
> On Wed 25-03-15 02:17:11, Johannes Weiner wrote:
> > 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
>
> it should be order <= PAGE_ALLOC_COSTLY

Oops, thanks for catching that. I'll fix it in v2.

> > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
>
> The resulting code looks much better and logical.
>
> After the COSTLY check is fixed.
> Acked-by: Michal Hocko <mhocko@suse.cz>

Thank you