Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756685AbXKIQPL (ORCPT ); Fri, 9 Nov 2007 11:15:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755143AbXKIQO7 (ORCPT ); Fri, 9 Nov 2007 11:14:59 -0500 Received: from gir.skynet.ie ([193.1.99.77]:51957 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754695AbXKIQO6 (ORCPT ); Fri, 9 Nov 2007 11:14:58 -0500 Date: Fri, 9 Nov 2007 16:14:55 +0000 To: Christoph Lameter Cc: akpm@linux-foundation.org, Lee.Schermerhorn@hp.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com, nacc@us.ibm.com, kamezawa.hiroyu@jp.fujitsu.com Subject: Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask Message-ID: <20071109161455.GB32088@skynet.ie> References: <20071109143226.23540.12907.sendpatchset@skynet.skynet.ie> <20071109143426.23540.44459.sendpatchset@skynet.skynet.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: mel@skynet.ie (Mel Gorman) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1848 Lines: 48 On (09/11/07 07:45), Christoph Lameter didst pronounce: > On Fri, 9 Nov 2007, Mel Gorman wrote: > > > struct page * fastcall > > __alloc_pages(gfp_t gfp_mask, unsigned int order, > > struct zonelist *zonelist) > > { > > + /* > > + * Use a temporary nodemask for __GFP_THISNODE allocations. If the > > + * cost of allocating on the stack or the stack usage becomes > > + * noticable, allocate the nodemasks per node at boot or compile time > > + */ > > + if (unlikely(gfp_mask & __GFP_THISNODE)) { > > + nodemask_t nodemask; > > Hmmm.. This places a potentially big structure on the stack. nodemask can > contain up to 1024 bits which means 128 bytes. Maybe keep an array of > gfp_thisnode nodemasks (node_nodemask?) and use node_nodemask[nid]? > That is what I was hinting at in the comment as a possible solution. > > + > > + return __alloc_pages_internal(gfp_mask, order, > > + zonelist, nodemask_thisnode(numa_node_id(), &nodemask)); > > Argh.... GFP_THISNODE must use the nid passed to alloc_pages_node and > *not* the local numa node id. Only if the node specified to alloc_pages > nodes is -1 will this work. > alloc_pages_node() calls __alloc_pages_nodemask() though where in this function if I'm reading it right is called without a node id. Given no other details on the nid, the current one seemed a logical choice. What I did notice when rechecking is I left the warning about THISNODE in by accident :( -- -- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/