From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754970Ab0KIDFs (ORCPT ); Mon, 8 Nov 2010 22:05:48 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:52699 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753843Ab0KIDFr (ORCPT ); Mon, 8 Nov 2010 22:05:47 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Andrea Arcangeli Subject: Re: [PATCH 29 of 66] don't alloc harder for gfp nomemalloc even if nowait Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Daisuke Nishimura , Chris Mason , Borislav Petkov In-Reply-To: References: Message-Id: <20101109120549.BC48.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Tue, 9 Nov 2010 12:05:40 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Andrea Arcangeli > > Not worth throwing away the precious reserved free memory pool for allocations > that can fail gracefully (either through mempool or because they're transhuge > allocations later falling back to 4k allocations). > > Signed-off-by: Andrea Arcangeli > Acked-by: Rik van Riel > --- > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1941,7 +1941,12 @@ gfp_to_alloc_flags(gfp_t gfp_mask) > alloc_flags |= (__force int) (gfp_mask & __GFP_HIGH); > > if (!wait) { > - alloc_flags |= ALLOC_HARDER; > + /* > + * Not worth trying to allocate harder for > + * __GFP_NOMEMALLOC even if it can't schedule. > + */ > + if (!(gfp_mask & __GFP_NOMEMALLOC)) > + alloc_flags |= ALLOC_HARDER; > /* > * Ignore cpuset if GFP_ATOMIC (!wait) rather than fail alloc. > * See also cpuset_zone_allowed() comment in kernel/cpuset.c. I like this. Reviewed-by: KOSAKI Motohiro