From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andy Whitcroft <apw@shadowen.org>,
Lee.Schermerhorn@hp.com, ak@suse.de, anton@samba.org,
mel@csn.ul.ie, akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] gfp.h: GFP_THISNODE can go to other nodes if some are unpopulated
Date: Mon, 11 Jun 2007 12:36:46 -0700 [thread overview]
Message-ID: <20070611193646.GB9920@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706111122010.18327@schroedinger.engr.sgi.com>
On 11.06.2007 [11:29:14 -0700], Christoph Lameter wrote:
> On Mon, 11 Jun 2007, Nishanth Aravamudan wrote:
>
> > These are the exact semantics, I expected. so I'll be happy to test/work
> > on these fixes.
> >
> > This would also make it unnecessary to add the populated checks in
> > various places, I think, as THISNODE will mean ONLYTHISNODE (and perhaps
> > should be renamed in the series).
>
> Here is a draft on how this could work:
<snip>
> Index: linux-2.6/mm/mempolicy.c
> ===================================================================
> --- linux-2.6.orig/mm/mempolicy.c 2007-06-11 11:13:09.000000000 -0700
> +++ linux-2.6/mm/mempolicy.c 2007-06-11 11:19:03.000000000 -0700
> @@ -1125,9 +1125,11 @@ static unsigned interleave_nodes(struct
> struct task_struct *me = current;
>
> nid = me->il_next;
> - next = next_node(nid, policy->v.nodes);
> - if (next >= MAX_NUMNODES)
> - next = first_node(policy->v.nodes);
> + do {
> + next = next_node(nid, policy->v.nodes);
> + if (next >= MAX_NUMNODES)
> + next = first_node(policy->v.nodes);
> + } while (!NODE_DATA(node)->present_pages);
> me->il_next = next;
> return nid;
> }
So, I'm splitting up the populated_map patch in two, so that these bits
or the hugetlbfs bits could be put on top of having that nodemask.
*but*, if this change occurs in mempolicy.c, I think we still have a
problem, where me->il_next could be initialized in do_set_mempolicy() to
a memoryless node:
if (new && new->policy == MPOL_INTERLEAVE)
current->il_next = first_node(new->v.nodes);
Since we return nid in mm/mempolicy.c, we've fix the problem for
subsequent intereaves, but not the first one. So should it be:
unsigned nid;
if (new && new->policy == MPOL_INTERLEAVE) {
nid = first_node(new->v.nodes);
while (!node_populated(nid)) {
nid = next_node(nid, new->v.nodes);
if (nid >= MAX_NUMNODES) {
mpol_free(current->mempolicy);
current->mempolicy = NULL;
mpol_set_task_struct_flag();
return -EINVAL;
}
}
}
??
Sorry if I'm way off here, just trying to get it right.
Thanks,
Nish
--
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-11 19:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 15:04 [PATCH] " Nishanth Aravamudan
2007-06-07 18:11 ` Christoph Lameter
2007-06-07 22:01 ` [PATCH v2] " Nishanth Aravamudan
2007-06-07 22:05 ` Christoph Lameter
2007-06-07 22:16 ` Nishanth Aravamudan
2007-06-11 12:49 ` Andy Whitcroft
2007-06-11 16:12 ` Christoph Lameter
2007-06-11 16:42 ` Christoph Lameter
2007-06-11 17:12 ` Nishanth Aravamudan
2007-06-11 18:29 ` Christoph Lameter
2007-06-11 18:46 ` Nishanth Aravamudan
2007-06-11 18:54 ` Christoph Lameter
2007-06-11 19:36 ` Nishanth Aravamudan [this message]
2007-06-11 19:43 ` Christoph Lameter
2007-06-11 20:18 ` Nishanth Aravamudan
2007-06-11 18:23 ` Lee Schermerhorn
2007-06-11 18:40 ` Christoph Lameter
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=20070611193646.GB9920@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=anton@samba.org \
--cc=apw@shadowen.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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