summary refs log tree commit diff
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2009-09-21 17:01:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 07:17:26 -0700
commitabfc3488118d48a2b8cce5a2345901aac6b03fee (patch)
tree37e39eeef9cb43716339315833be3592b01f9a64 /mm/migrate.c
parentf52407ce2deac76c87abc8211a63ea152ba72d54 (diff)
downloadlinux-abfc3488118d48a2b8cce5a2345901aac6b03fee.tar.gz
memory hotplug: migrate swap cache page
In test, some pages in swap-cache can't be migrated, as they aren't rmap.

unmap_and_move() ignores swap-cache page which is just read in and hasn't
rmap (see the comments in the code), but swap_aops provides .migratepage.
Better to migrate such pages instead of ignore them.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Yakui Zhao <yakui.zhao@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 939888f9ddab..0edeac91348d 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -147,7 +147,7 @@ out:
 static void remove_file_migration_ptes(struct page *old, struct page *new)
 {
 	struct vm_area_struct *vma;
-	struct address_space *mapping = page_mapping(new);
+	struct address_space *mapping = new->mapping;
 	struct prio_tree_iter iter;
 	pgoff_t pgoff = new->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
 
@@ -664,13 +664,15 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 			 *    needs to be effective.
 			 */
 			try_to_free_buffers(page);
+			goto rcu_unlock;
 		}
-		goto rcu_unlock;
+		goto skip_unmap;
 	}
 
 	/* Establish migration ptes or remove ptes */
 	try_to_unmap(page, 1);
 
+skip_unmap:
 	if (!page_mapped(page))
 		rc = move_to_new_page(newpage, page);