From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by kanga.kvack.org (Postfix) with ESMTP id 40A076B0038 for ; Fri, 20 Nov 2015 18:33:19 -0500 (EST) Received: by pacdm15 with SMTP id dm15so130171445pac.3 for ; Fri, 20 Nov 2015 15:33:19 -0800 (PST) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com. [2607:f8b0:400e:c03::230]) by mx.google.com with ESMTPS id u81si1777156pfa.147.2015.11.20.15.33.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2015 15:33:18 -0800 (PST) Received: by padhx2 with SMTP id hx2so130212658pad.1 for ; Fri, 20 Nov 2015 15:33:18 -0800 (PST) Date: Fri, 20 Nov 2015 15:33:17 -0800 (PST) From: David Rientjes Subject: Re: [RFC 3/3] mm: use watermak checks for __GFP_REPEAT high order allocations In-Reply-To: <20151120091825.GD16698@dhcp22.suse.cz> Message-ID: References: <1447851840-15640-1-git-send-email-mhocko@kernel.org> <1447851840-15640-4-git-send-email-mhocko@kernel.org> <20151120091825.GD16698@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: linux-mm@kvack.org, Andrew Morton , Linus Torvalds , Mel Gorman , Johannes Weiner , Tetsuo Handa , Hillf Danton , KAMEZAWA Hiroyuki On Fri, 20 Nov 2015, Michal Hocko wrote: > > > @@ -3167,24 +3166,21 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > > > > > > /* > > > * Do not retry high order allocations unless they are __GFP_REPEAT > > > - * and even then do not retry endlessly unless explicitly told so > > > + * unless explicitly told so. > > > */ > > > - pages_reclaimed += did_some_progress; > > > - if (order > PAGE_ALLOC_COSTLY_ORDER) { > > > - if (!(gfp_mask & __GFP_NOFAIL) && > > > - (!(gfp_mask & __GFP_REPEAT) || pages_reclaimed >= (1< > > - goto noretry; > > > - > > > - if (did_some_progress) > > > - goto retry; > > > - } > > > + if (order > PAGE_ALLOC_COSTLY_ORDER && > > > + !(gfp_mask & (__GFP_REPEAT|__GFP_NOFAIL))) > > > + goto noretry; > > > > Who is allocating order > PAGE_ALLOC_COSTLY_ORDER with __GFP_REPEAT and > > would be affected by this change? > > E.g. hugetlb pages. I have tested this in my testing scenario 3. > If that's the only high-order user of __GFP_REPEAT, we might want to consider dropping it. I believe the hugetlb usecase would only be relevant in early init (when __GFP_REPEAT shouldn't logically help) and when returning surplus pages due to hugetlb overcommit. Since hugetlb overcommit is best effort and we already know that the pages_reclaimed >= (1< email@kvack.org