login
Header Space

 
 

Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Christoph Lameter <clameter@...>
Cc: Mel Gorman <mel@...>, <akpm@...>, <Lee.Schermerhorn@...>, <linux-kernel@...>, <linux-mm@...>, <rientjes@...>, <kamezawa.hiroyu@...>
Date: Monday, October 8, 2007 - 11:17 pm

On 08.10.2007 [18:56:05 -0700], Christoph Lameter wrote:

It seems like I would zonelist_node_idx() for this, along the lines of:

	static nodemask_t *nodemask_thisnode(nodemask_t *nodemask,
		struct zonelist *zonelist)
	{
		int nid = zonelist_node_idx(zonelist);
		/* Build a nodemask for just this node */
		nodes_clear(*nodemask);
		node_set(nid, *nodemask);

		return nodemask;
	}

But I think I need to check that zonelist->_zonerefs->zone is !NULL, given this
definition of zonelist_node_idx()

	static inline int zonelist_node_idx(struct zoneref *zoneref)
	{
	#ifdef CONFIG_NUMA
		/* zone_to_nid not available in this context */
		return zoneref->zone->node;
	#else
		return 0;
	#endif /* CONFIG_NUMA */
	}

and this comment in __alloc_pages_internal():

	....
	z = zonelist->_zonerefs;  /* the list of zones suitable for gfp_mask */

	if (unlikely(!z->zone)) {
		/*
		 * Happens if we have an empty zonelist as a result of
		 * GFP_THISNODE being used on a memoryless node
		 */
		return NULL;
	}
	...

It seems like zoneref->zone may be NULL in zonelist_node_idx()? Maybe
someone else should look into resolving this :)

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 5/6] Filter based on a nodemask as well as a gfp_..., Lee Schermerhorn, (Fri Sep 28, 11:37 am)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Nishanth Aravamudan, (Mon Oct 8, 9:11 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Lee Schermerhorn, (Wed Oct 10, 11:53 am)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Nishanth Aravamudan, (Wed Oct 10, 12:05 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Nishanth Aravamudan, (Tue Oct 9, 2:12 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Nishanth Aravamudan, (Tue Oct 9, 12:25 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Christoph Lameter, (Tue Oct 9, 2:47 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Christoph Lameter, (Mon Oct 8, 9:56 pm)
Re: [PATCH 6/6] Use one zonelist that is filtered by nodemask, Nishanth Aravamudan, (Mon Oct 8, 11:17 pm)
speck-geostationary