From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755414AbcGTWAV (ORCPT ); Wed, 20 Jul 2016 18:00:21 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34720 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226AbcGTWAQ (ORCPT ); Wed, 20 Jul 2016 18:00:16 -0400 Date: Wed, 20 Jul 2016 15:00:08 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Vlastimil Babka cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Mel Gorman , Joonsoo Kim , Rik van Riel Subject: Re: [PATCH 3/8] mm, page_alloc: don't retry initial attempt in slowpath In-Reply-To: <7f97c5e0-731c-0431-e9f6-b53cd8f87f61@suse.cz> Message-ID: References: <20160718112302.27381-1-vbabka@suse.cz> <20160718112302.27381-4-vbabka@suse.cz> <7f97c5e0-731c-0431-e9f6-b53cd8f87f61@suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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