aboutsummaryrefslogtreecommitdiffstats
path: root/mm/ksm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/ksm.c')
-rw-r--r--mm/ksm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index c067e8dbcc79..c059ca1c9356 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1342,16 +1342,6 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item,
1342 return NULL; 1342 return NULL;
1343 } 1343 }
1344 1344
1345 /*
1346 * If tree_page has been migrated to another NUMA node, it
1347 * will be flushed out and put into the right unstable tree
1348 * next time: only merge with it if merge_across_nodes.
1349 */
1350 if (!ksm_merge_across_nodes && page_to_nid(tree_page) != nid) {
1351 put_page(tree_page);
1352 return NULL;
1353 }
1354
1355 ret = memcmp_pages(page, tree_page); 1345 ret = memcmp_pages(page, tree_page);
1356 1346
1357 parent = *new; 1347 parent = *new;
@@ -1361,6 +1351,15 @@ struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item,
1361 } else if (ret > 0) { 1351 } else if (ret > 0) {
1362 put_page(tree_page); 1352 put_page(tree_page);
1363 new = &parent->rb_right; 1353 new = &parent->rb_right;
1354 } else if (!ksm_merge_across_nodes &&
1355 page_to_nid(tree_page) != nid) {
1356 /*
1357 * If tree_page has been migrated to another NUMA node,
1358 * it will be flushed out and put in the right unstable
1359 * tree next time: only merge with it when across_nodes.
1360 */
1361 put_page(tree_page);
1362 return NULL;
1364 } else { 1363 } else {
1365 *tree_pagep = tree_page; 1364 *tree_pagep = tree_page;
1366 return tree_rmap_item; 1365 return tree_rmap_item;