[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1607201459170.29381@chino.kir.corp.google.com>
Date: Wed, 20 Jul 2016 15:00:08 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Vlastimil Babka <vbabka@...e.cz>
cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Michal Hocko <mhocko@...nel.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 3/8] mm, page_alloc: don't retry initial attempt in
slowpath
On Wed, 20 Jul 2016, Vlastimil Babka wrote:
> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> >> index eb1968a1041e..30443804f156 100644
> >> --- a/mm/page_alloc.c
> >> +++ b/mm/page_alloc.c
> >> @@ -3541,35 +3541,42 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> >> */
> >> alloc_flags = gfp_to_alloc_flags(gfp_mask);
> >>
> >> + if (gfp_mask & __GFP_KSWAPD_RECLAIM)
> >> + wake_all_kswapds(order, ac);
> >> +
> >> + /*
> >> + * The adjusted alloc_flags might result in immediate success, so try
> >> + * that first
> >> + */
> >> + page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
> >> + if (page)
> >> + goto got_pg;
> >
> > Any reason to not test gfp_pfmemalloc_allowed() here? For contexts where
> > it returns true, it seems like the above would be an unneeded failure if
> > ALLOC_WMARK_MIN would have failed. No strong opinion.
>
> Yeah, two reasons:
> 1 - less overhead (for the test) if we went to slowpath just to wake up
> kswapd and then succeed on min watermark
> 2 - try all zones with min watermark before resorting to no watermark
> (if allowed), so we don't needlessly put below min watermark the first
> zone in zonelist, while some later zone would still be above watermark
>
The second point makes sense, thanks!
Acked-by: David Rientjes <rientjes@...gle.com>
Powered by blists - more mailing lists