summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mempolicy.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index a388888b6fcf..d3c5de47ff6d 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1005,6 +1005,26 @@ int do_migrate_pages(struct mm_struct *mm,
1005 int dest = 0; 1005 int dest = 0;
1006 1006
1007 for_each_node_mask(s, tmp) { 1007 for_each_node_mask(s, tmp) {
1008
1009 /*
1010 * do_migrate_pages() tries to maintain the relative
1011 * node relationship of the pages established between
1012 * threads and memory areas.
1013 *
1014 * However if the number of source nodes is not equal to
1015 * the number of destination nodes we can not preserve
1016 * this node relative relationship. In that case, skip
1017 * copying memory from a node that is in the destination
1018 * mask.
1019 *
1020 * Example: [2,3,4] -> [3,4,5] moves everything.
1021 * [0-7] - > [3,4,5] moves only 0,1,2,6,7.
1022 */
1023
1024 if ((nodes_weight(*from_nodes) != nodes_weight(*to_nodes)) &&
1025 (node_isset(s, *to_nodes)))
1026 continue;
1027
1008 d = node_remap(s, *from_nodes, *to_nodes); 1028 d = node_remap(s, *from_nodes, *to_nodes);
1009 if (s == d) 1029 if (s == d)
1010 continue; 1030 continue;