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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail191.messagelabs.com (mail191.messagelabs.com [216.82.242.19]) by kanga.kvack.org (Postfix) with SMTP id 216516B00BD for ; Mon, 8 Nov 2010 22:05:56 -0500 (EST) Received: from fgwmail6.fujitsu.co.jp (fgwmail6.fujitsu.co.jp [192.51.44.36]) by fgwmail9.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oA935nad030349 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Tue, 9 Nov 2010 12:05:49 +0900 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oA935hES022095 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Tue, 9 Nov 2010 12:05:43 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 8E43245DE50 for ; Tue, 9 Nov 2010 12:05:42 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 00E7C45DE4D for ; Tue, 9 Nov 2010 12:05:42 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id CFEEA1DB804F for ; Tue, 9 Nov 2010 12:05:41 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 623D91DB8045 for ; Tue, 9 Nov 2010 12:05:41 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [PATCH 29 of 66] don't alloc harder for gfp nomemalloc even if nowait 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 Date: Tue, 9 Nov 2010 12:05:40 +0900 (JST) Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli 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 List-ID: > 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org