From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
akpm@linux-foundation.org, linux-mm@kvack.org, ak@suse.de
Subject: Re: [patch 2/3] Fix GFP_THISNODE behavior for memoryless nodes
Date: Thu, 14 Jun 2007 07:23:34 -0700 [thread overview]
Message-ID: <20070614142334.GB7469@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706140004070.11676@schroedinger.engr.sgi.com>
On 14.06.2007 [00:07:28 -0700], Christoph Lameter wrote:
> On Wed, 13 Jun 2007, Lee Schermerhorn wrote:
>
> > --- Linux.orig/include/linux/gfp.h 2007-06-13 16:36:02.000000000 -0400
> > +++ Linux/include/linux/gfp.h 2007-06-13 16:38:41.000000000 -0400
> > @@ -168,6 +168,9 @@ FASTCALL(__alloc_pages(gfp_t, unsigned i
> > static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
> > unsigned int order)
> > {
> > + pg_data_t *pgdat;
> > + struct zonelist *zonelist;
> > +
> > if (unlikely(order >= MAX_ORDER))
> > return NULL;
> >
> > @@ -179,11 +182,13 @@ static inline struct page *alloc_pages_n
> > * Check for the special case that GFP_THISNODE is used on a
> > * memoryless node
> > */
> > - if ((gfp_mask & __GFP_THISNODE) && !node_memory(nid))
> > + pgdat = NODE_DATA(nid);
> > + zonelist = pgdat->node_zonelists + gfp_zone(gfp_mask);
> > + if ((gfp_mask & __GFP_THISNODE) &&
> > + pgdat != zonelist->zones[0]->zone_pgdat)
> > return NULL;
> >
> > - return __alloc_pages(gfp_mask, order,
> > - NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
> > + return __alloc_pages(gfp_mask, order, zonelist);
> > }
>
> Good idea but I think this does not address the case where the DMA
> zone of a node was moved to the end of the zonelist. In that case the
> first zone is not on the first pgdat but the node has memory. The
> memory of the node is listed elsewhere in the nodelist. I can probably
> modify __alloc_pages to make GFP_THISNODE to check all zones but we do
> not have the pgdat reference there. Sigh.
>
> How about generating a special THISNODE zonelist in build_zonelist
> that only contains the zones of a single node. Then just use that one
> if GFP_THISNODE is set. Then we get rid of all the GFP_THISNODE crap
> that I added to __alloc_pages?
Makes sense to me.
Thanks,
NIsh
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-06-14 14:23 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-12 20:48 [patch 0/3] Fixes for NUMA allocations on " clameter
2007-06-12 20:48 ` [patch 1/3] NUMA: introduce node_memory_map clameter
2007-06-12 21:03 ` David Rientjes
2007-06-12 21:08 ` Christoph Lameter
2007-06-12 21:10 ` David Rientjes
2007-06-12 21:27 ` Christoph Lameter
2007-06-12 21:34 ` David Rientjes
2007-06-12 21:37 ` Christoph Lameter
2007-06-12 21:38 ` David Rientjes
2007-06-12 21:36 ` Nishanth Aravamudan
2007-06-12 21:39 ` Christoph Lameter
2007-06-12 21:42 ` Nishanth Aravamudan
2007-06-12 21:45 ` David Rientjes
2007-06-12 22:26 ` Christoph Lameter
2007-06-12 22:32 ` Nishanth Aravamudan
2007-06-13 9:14 ` Andy Whitcroft
2007-06-12 20:48 ` [patch 2/3] Fix GFP_THISNODE behavior for memoryless nodes clameter
2007-06-12 21:03 ` David Rientjes
2007-06-12 21:07 ` Christoph Lameter
2007-06-12 21:08 ` David Rientjes
2007-06-12 21:25 ` Christoph Lameter
2007-06-12 21:34 ` David Rientjes
2007-06-12 21:51 ` Nishanth Aravamudan
2007-06-13 21:10 ` Lee Schermerhorn
2007-06-13 21:57 ` Nishanth Aravamudan
2007-06-13 22:46 ` Christoph Lameter
2007-06-13 23:11 ` Nishanth Aravamudan
2007-06-13 23:15 ` Christoph Lameter
2007-06-13 23:20 ` Nishanth Aravamudan
2007-06-13 23:26 ` Christoph Lameter
2007-06-13 23:32 ` Nishanth Aravamudan
2007-06-13 23:53 ` Christoph Lameter
2007-06-14 0:04 ` Nishanth Aravamudan
2007-06-14 14:18 ` Lee Schermerhorn
2007-06-14 14:24 ` Christoph Lameter
2007-06-14 14:55 ` Lee Schermerhorn
2007-06-14 15:51 ` Christoph Lameter
2007-06-14 7:07 ` Christoph Lameter
2007-06-14 14:23 ` Nishanth Aravamudan [this message]
2007-06-12 20:48 ` [patch 3/3] Fix MPOL_INTERLEAVE " clameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070614142334.GB7469@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox