提交 57fc4a5e 编写于 作者: A Andrea Arcangeli 提交者: Linus Torvalds

mm: when migrate_pages returns 0, all pages must have been released

In some cases migrate_pages could return zero while still leaving a few
pages in the pagelist (and some caller wouldn't notice it has to call
putback_lru_pages after commit cf608ac1 ("mm: compaction: fix
COMPACTPAGEFAILED counting")).

Add one missing putback_lru_pages not added by commit cf608ac1 ("mm:
compaction: fix COMPACTPAGEFAILED counting").
Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
Signed-off-by: NMinchan Kim <minchan.kim@gmail.com>
Reviewed-by: NMinchan Kim <minchan.kim@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Acked-by: NMel Gorman <mel@csn.ul.ie>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 552b372b
......@@ -1419,6 +1419,7 @@ int soft_offline_page(struct page *page, int flags)
ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,
0, true);
if (ret) {
putback_lru_pages(&pagelist);
pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
pfn, ret, page->flags);
if (ret > 0)
......
......@@ -772,6 +772,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
unlock:
unlock_page(page);
move_newpage:
if (rc != -EAGAIN) {
/*
* A page that has been migrated has all references
......@@ -785,8 +786,6 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
putback_lru_page(page);
}
move_newpage:
/*
* Move the new page to the LRU. If migration was not successful
* then this will free the page.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册