Re: [PATCH -mm V3] do_migrate_pages() calls migrate_to_node() even if task is already on a correct node

KOSAKI Motohiro
2012-04-27T01:14:39Z

> @@ -1012,6 +1012,26 @@ int do_migrate_pages(struct mm_struct *mm,
>                int dest = 0;
>
>                for_each_node_mask(s, tmp) {
> +
> +                       /*
> +                        * do_migrate_pages() tries to maintain the
> +                        * relative node relationship of the pages
> +                        * established between threads and memory areas.
> +                        *
> +                        * However if the number of source nodes is not
> +                        * equal to the number of destination nodes we
> +                        * can not preserve this node relative relationship.
> +                        * In that case, skip copying memory from a node
> that
> +                        * is in the destination mask.
> +                        *
> +                        * Example: [2,3,4] -> [3,4,5] moves everything.
> +                        *                 [0-7] - > [3,4,5] moves only
> 0,1,2,6,7.
> +                        */
> +
> +                       if ((nodes_weight(*from_nodes) !=
> nodes_weight(*to_nodes)) &&
> +                                               (node_isset(s, *to_nodes)))
> +                               continue;
> +
>                        d = node_remap(s, *from_nodes, *to_nodes);
>                        if (s == d)
>                                continue;

Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥