提交 abfc3488 编写于 作者: S Shaohua Li 提交者: Linus Torvalds

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: NShaohua 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f52407ce
...@@ -147,7 +147,7 @@ static void remove_migration_pte(struct vm_area_struct *vma, ...@@ -147,7 +147,7 @@ static void remove_migration_pte(struct vm_area_struct *vma,
static void remove_file_migration_ptes(struct page *old, struct page *new) static void remove_file_migration_ptes(struct page *old, struct page *new)
{ {
struct vm_area_struct *vma; struct vm_area_struct *vma;
struct address_space *mapping = page_mapping(new); struct address_space *mapping = new->mapping;
struct prio_tree_iter iter; struct prio_tree_iter iter;
pgoff_t pgoff = new->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); 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, ...@@ -664,13 +664,15 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
* needs to be effective. * needs to be effective.
*/ */
try_to_free_buffers(page); try_to_free_buffers(page);
}
goto rcu_unlock; goto rcu_unlock;
} }
goto skip_unmap;
}
/* Establish migration ptes or remove ptes */ /* Establish migration ptes or remove ptes */
try_to_unmap(page, 1); try_to_unmap(page, 1);
skip_unmap:
if (!page_mapped(page)) if (!page_mapped(page))
rc = move_to_new_page(newpage, page); rc = move_to_new_page(newpage, page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册