linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Bob Liu <lliubbo@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	cl@linux-foundation.org, andi@firstfloor.org,
	minchar.kim@gmail.com
Subject: Re: [RFC][PATCH] migrate_pages:skip migration between intersect nodes
Date: Mon, 29 Mar 2010 11:31:48 -0400	[thread overview]
Message-ID: <1269876708.13829.30.camel@useless.americas.hpqcorp.net> (raw)
In-Reply-To: <1269874629-1736-1-git-send-email-lliubbo@gmail.com>

On Mon, 2010-03-29 at 22:57 +0800, Bob Liu wrote:
> In current do_migrate_pages(),if from_nodes and to_nodes have some
> intersect nodes,pages in these intersect nodes will also be
> migrated.
> eg. Assume that, from_nodes: 1,2,3,4 to_nodes: 2,3,4,5. Then these
> migrates will happen:
> migrate_pages(4,5);
> migrate_pages(3,4);
> migrate_pages(2,3);
> migrate_pages(1,2);
> 
> But the user just want all pages in from_nodes move to to_nodes,
> only migrate(1,2)(ignore the intersect nodes.) can satisfied 
> the user's request.
> 
> I amn't sure what's migrate_page's semantic.
> Hoping for your suggestions.

I believe that the current code matches the intended semantics.  I can't
find a man pages for the migrate_pages() system call, but the
migratepages(8) man page says:

"If  multiple  nodes  are specified for from-nodes or to-nodes then an
attempt is made to preserve the relative location of each page in each
nodeset."

If one just wanted to move all task pages from node 1 to 2, one would
specify:

to_nodes: 1
from_nodes: 2

Christoph L may have more to say.  I believe he wrote migrate_pages()
and that very interesting remapping function.

Lee


> 
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> ---
>  mm/mempolicy.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 08f40a2..c6dd931 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -922,7 +922,7 @@ int do_migrate_pages(struct mm_struct *mm,
>  	 * moved to an empty node, then there is nothing left worth migrating.
>  	 */
>  
> -	tmp = *from_nodes;
> +	nodes_andnot(tmp, *from_nodes, *to_nodes);
>  	while (!nodes_empty(tmp)) {
>  		int s,d;
>  		int source = -1;
> @@ -935,10 +935,7 @@ int do_migrate_pages(struct mm_struct *mm,
>  
>  			source = s;	/* Node moved. Memorize */
>  			dest = d;
> -
> -			/* dest not in remaining from nodes? */
> -			if (!node_isset(dest, tmp))
> -				break;
> +			break;
>  		}
>  		if (source == -1)
>  			break;

--
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>

  reply	other threads:[~2010-03-29 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 14:57 Bob Liu
2010-03-29 15:31 ` Lee Schermerhorn [this message]
2010-03-29 23:41   ` KOSAKI Motohiro
2010-03-30 16:28     ` Christoph Lameter
2010-03-30 16:49       ` Andi Kleen
2010-03-30  0:03 ` Minchan Kim
2010-03-30 16:29   ` Christoph Lameter
2010-03-31  1:36     ` Bob Liu
2010-03-31  3:56       ` Minchan Kim
2010-03-31  4:02         ` Bob Liu
2010-03-31 14:17       ` 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=1269876708.13829.30.camel@useless.americas.hpqcorp.net \
    --to=lee.schermerhorn@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=lliubbo@gmail.com \
    --cc=minchar.kim@gmail.com \
    /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