From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id 845ED6004AB for ; Sun, 21 Feb 2010 09:18:49 -0500 (EST) Message-Id: <20100221141756.929160492@redhat.com> Date: Sun, 21 Feb 2010 15:10:35 +0100 From: aarcange@redhat.com Subject: [patch 26/36] dont alloc harder for gfp nomemalloc even if nowait References: <20100221141009.581909647@redhat.com> Content-Disposition: inline; filename=gfp_nomemalloc_wait Sender: owner-linux-mm@kvack.org To: linux-mm@kvack.org Cc: Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , Andrew Morton , bpicco@redhat.com, KOSAKI Motohiro , Balbir Singh , Arnd Bergmann , Andrea Arcangeli 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 --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1773,7 +1773,11 @@ gfp_to_alloc_flags(gfp_t gfp_mask) */ alloc_flags |= (gfp_mask & __GFP_HIGH); - if (!wait) { + /* + * Not worth trying to allocate harder for __GFP_NOMEMALLOC + * even if it can't schedule. + */ + if (!wait && !(gfp_mask & __GFP_NOMEMALLOC)) { alloc_flags |= ALLOC_HARDER; /* * Ignore cpuset if GFP_ATOMIC (!wait) rather than fail alloc. -- 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/ . Don't email: email@kvack.org