The patch titled mm/compaction: check migrate_pages's return value instead of list_empty has been added to the -mm tree. Its filename is mm-compaction-check-migrate_pagess-return-value-instead-of-list_empty.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/compaction: check migrate_pages's return value instead of list_empty From: Minchan Kim <minchan.kim@xxxxxxxxx> Many migrate_page's caller check return value instead of list_empy by cf608ac19c ("mm: compaction: fix COMPACTPAGEFAILED counting"). This patch makes compaction's migrate_pages consistent with others. This patch should not change old behavior. Signed-off-by: Minchan Kim <minchan.kim@xxxxxxxxx> Cc: Mel Gorman <mel@xxxxxxxxx> Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/compaction.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN mm/compaction.c~mm-compaction-check-migrate_pagess-return-value-instead-of-list_empty mm/compaction.c --- a/mm/compaction.c~mm-compaction-check-migrate_pagess-return-value-instead-of-list_empty +++ a/mm/compaction.c @@ -508,12 +508,13 @@ static int compact_zone(struct zone *zon while ((ret = compact_finished(zone, cc)) == COMPACT_CONTINUE) { unsigned long nr_migrate, nr_remaining; + int err; if (!isolate_migratepages(zone, cc)) continue; nr_migrate = cc->nr_migratepages; - migrate_pages(&cc->migratepages, compaction_alloc, + err = migrate_pages(&cc->migratepages, compaction_alloc, (unsigned long)cc, false, cc->sync); update_nr_listpages(cc); @@ -527,7 +528,7 @@ static int compact_zone(struct zone *zon nr_remaining); /* Release LRU pages not migrated */ - if (!list_empty(&cc->migratepages)) { + if (err) { putback_lru_pages(&cc->migratepages); cc->nr_migratepages = 0; } _ Patches currently in -mm which might be from minchan.kim@xxxxxxxxx are origin.patch linux-next.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 mm-vmap-area-cache.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