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 cf608ac19c ("mm: compaction: fix
COMPACTPAGEFAILED counting")).

Add one missing putback_lru_pages not added by commit cf608ac19c ("mm:
compaction: fix COMPACTPAGEFAILED counting").

Signed-off-by: Andrea Arcangeli <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Cc: Christoph Lameter <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Andrea Arcangeli 2011-02-01 15:52:32 -08:00 • committed by Linus Torvalds
commit 57fc4a5ee3
2 changed files with 2 additions and 2 deletions

View file

@ -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.