Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759043AbXIMPuX (ORCPT ); Thu, 13 Sep 2007 11:50:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752892AbXIMPuL (ORCPT ); Thu, 13 Sep 2007 11:50:11 -0400 Received: from atlrel9.hp.com ([156.153.255.214]:57875 "EHLO atlrel9.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbXIMPuJ (ORCPT ); Thu, 13 Sep 2007 11:50:09 -0400 Subject: Re: [PATCH 5/6] Filter based on a nodemask as well as a gfp_mask From: Lee Schermerhorn To: Mel Gorman Cc: kamezawa.hiroyu@jp.fujitsu.com, clameter@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org In-Reply-To: <20070912210625.31625.36220.sendpatchset@skynet.skynet.ie> References: <20070912210444.31625.65810.sendpatchset@skynet.skynet.ie> <20070912210625.31625.36220.sendpatchset@skynet.skynet.ie> Content-Type: text/plain Organization: HP/OSLO Date: Thu, 13 Sep 2007 11:49:40 -0400 Message-Id: <1189698581.5013.74.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2663 Lines: 65 On Wed, 2007-09-12 at 22:06 +0100, Mel Gorman wrote: > The MPOL_BIND policy creates a zonelist that is used for allocations belonging > to that thread that can use the policy_zone. As the per-node zonelist is > already being filtered based on a zone id, this patch adds a version of > __alloc_pages() that takes a nodemask for further filtering. This eliminates > the need for MPOL_BIND to create a custom zonelist. A positive benefit of > this is that allocations using MPOL_BIND now use the local-node-ordered > zonelist instead of a custom node-id-ordered zonelist. > > Signed-off-by: Mel Gorman > --- > > fs/buffer.c | 2 > include/linux/cpuset.h | 4 - > include/linux/gfp.h | 4 + > include/linux/mempolicy.h | 3 > include/linux/mmzone.h | 65 ++++++++++++++---- > kernel/cpuset.c | 18 +---- > mm/mempolicy.c | 145 ++++++++++++----------------------------- > mm/page_alloc.c | 40 +++++++---- > 8 files changed, 136 insertions(+), 145 deletions(-) > diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.23-rc4-mm1-020_zoneid_zonelist/kernel/cpuset.c linux-2.6.23-rc4-mm1-030_filter_nodemask/kernel/cpuset.c > --- linux-2.6.23-rc4-mm1-020_zoneid_zonelist/kernel/cpuset.c 2007-09-12 16:05:35.000000000 +0100 > +++ linux-2.6.23-rc4-mm1-030_filter_nodemask/kernel/cpuset.c 2007-09-12 16:05:44.000000000 +0100 > @@ -1516,22 +1516,14 @@ nodemask_t cpuset_mems_allowed(struct ta > } > > /** > - * cpuset_zonelist_valid_mems_allowed - check zonelist vs. curremt mems_allowed > - * @zl: the zonelist to be checked > + * cpuset_nodemask_valid_mems_allowed - check nodemask vs. curremt mems_allowed > + * @nodemask: the nodemask to be checked > * > - * Are any of the nodes on zonelist zl allowed in current->mems_allowed? > + * Are any of the nodes in the nodemask allowed in current->mems_allowed? > */ > -int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) > +int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) > { > - int i; > - > - for (i = 0; zl->_zonerefs[i].zone; i++) { > - int nid = zonelist_node_idx(zl->_zonerefs[i]); > - > - if (node_isset(nid, current->mems_allowed)) > - return 1; > - } > - return 0; > + return nodes_intersect(nodemask, current->mems_allowed); nodes_intersects(*nodemask, ... > } > > /* Still preping for test. Lee - 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/