From: Christoph Lameter Edit comments to be nicer better and reflect the current state of page migration. Remove useless BUG_ON() in migrate_entry_wait() since migration_entry_to_page() already does a BUG_ON(). Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- vm/page_migration | 0 mm/migrate.c | 17 +++++++++-------- linux/swap.h | 0 3 files changed, 9 insertions(+), 8 deletions(-) diff -puN Documentation/vm/page_migration~more-page-migration-use-migration-entries-for-file-pages-update-comments-8 Documentation/vm/page_migration diff -puN include/linux/swap.h~more-page-migration-use-migration-entries-for-file-pages-update-comments-8 include/linux/swap.h diff -puN mm/migrate.c~more-page-migration-use-migration-entries-for-file-pages-update-comments-8 mm/migrate.c --- devel/mm/migrate.c~more-page-migration-use-migration-entries-for-file-pages-update-comments-8 2006-05-11 15:18:47.000000000 -0700 +++ devel-akpm/mm/migrate.c 2006-05-11 15:18:47.000000000 -0700 @@ -460,19 +460,20 @@ int buffer_migrate_page(struct address_s } EXPORT_SYMBOL(buffer_migrate_page); +/* + * Default handling if a filesystem does not provide a migration function. + */ static int fallback_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page) { - /* - * Default handling if a filesystem does not provide - * a migration function. We can only migrate clean - * pages so try to write out any dirty pages first. - */ if (PageDirty(page)) { /* - * Remove the migration entries because pageout() may - * unlock which may result in migration entries pointing - * to unlocked pages. + * A dirty page may imply that the underlying filesystem has + * the page on some queue. So the page must be clean for + * migration. Writeout may mean we loose the lock and the + * page state is no longer what we checked for earlier. + * At this point we know that the migration attempt cannot + * be successful. */ remove_migration_ptes(page, page); _