diff options
author | Shaohua Li <shaohua.li@intel.com> | 2009-09-21 20:01:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:26 -0400 |
commit | abfc3488118d48a2b8cce5a2345901aac6b03fee (patch) | |
tree | 37e39eeef9cb43716339315833be3592b01f9a64 | |
parent | f52407ce2deac76c87abc8211a63ea152ba72d54 (diff) |
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>
-rw-r--r-- | mm/migrate.c | 6 |
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: | |||
147 | static void remove_file_migration_ptes(struct page *old, struct page *new) | 147 | static void remove_file_migration_ptes(struct page *old, struct page *new) |
148 | { | 148 | { |
149 | struct vm_area_struct *vma; | 149 | struct vm_area_struct *vma; |
150 | struct address_space *mapping = page_mapping(new); | 150 | struct address_space *mapping = new->mapping; |
151 | struct prio_tree_iter iter; | 151 | struct prio_tree_iter iter; |
152 | pgoff_t pgoff = new->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | 152 | pgoff_t pgoff = new->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); |
153 | 153 | ||
@@ -664,13 +664,15 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private, | |||
664 | * needs to be effective. | 664 | * needs to be effective. |
665 | */ | 665 | */ |
666 | try_to_free_buffers(page); | 666 | try_to_free_buffers(page); |
667 | goto rcu_unlock; | ||
667 | } | 668 | } |
668 | goto rcu_unlock; | 669 | goto skip_unmap; |
669 | } | 670 | } |
670 | 671 | ||
671 | /* Establish migration ptes or remove ptes */ | 672 | /* Establish migration ptes or remove ptes */ |
672 | try_to_unmap(page, 1); | 673 | try_to_unmap(page, 1); |
673 | 674 | ||
675 | skip_unmap: | ||
674 | if (!page_mapped(page)) | 676 | if (!page_mapped(page)) |
675 | rc = move_to_new_page(newpage, page); | 677 | rc = move_to_new_page(newpage, page); |
676 | 678 | ||