The patch titled mm: when migrate_pages returns 0, all pages must have been released has been added to the -mm tree. Its filename is mm-when-migrate_pages-returns-0-all-pages-must-have-been-released.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mm: when migrate_pages returns 0, all pages must have been released From: Andrea Arcangeli <aarcange@xxxxxxxxxx> 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 cf608ac19c9 ("mm: compaction: fix COMPACTPAGEFAILED counting")). Add one missing putback_lru_pages not added by commit cf608ac19c95 ("mm: compaction: fix COMPACTPAGEFAILED counting"). Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Signed-off-by: Minchan Kim <minchan.kim@xxxxxxxxx> Reviewed-by: Minchan Kim <minchan.kim@xxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Acked-by: Mel Gorman <mel@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 1 + mm/migrate.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff -puN mm/memory-failure.c~mm-when-migrate_pages-returns-0-all-pages-must-have-been-released mm/memory-failure.c --- a/mm/memory-failure.c~mm-when-migrate_pages-returns-0-all-pages-must-have-been-released +++ a/mm/memory-failure.c @@ -1419,6 +1419,7 @@ int soft_offline_page(struct page *page, 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) diff -puN mm/migrate.c~mm-when-migrate_pages-returns-0-all-pages-must-have-been-released mm/migrate.c --- a/mm/migrate.c~mm-when-migrate_pages-returns-0-all-pages-must-have-been-released +++ a/mm/migrate.c @@ -772,6 +772,7 @@ uncharge: unlock: unlock_page(page); +move_newpage: if (rc != -EAGAIN) { /* * A page that has been migrated has all references @@ -785,8 +786,6 @@ unlock: putback_lru_page(page); } -move_newpage: - /* * Move the new page to the LRU. If migration was not successful * then this will free the page. _ Patches currently in -mm which might be from aarcange@xxxxxxxxxx are origin.patch mm-when-migrate_pages-returns-0-all-pages-must-have-been-released.patch mm-migration-fix-page-corruption-during-hugepage-migration.patch mm-compaction-check-migrate_pagess-return-value-instead-of-list_empty.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html