Skip to content

Commit 35512ec

Browse files
koct9itorvalds
authored andcommitted
mm: postpone migrated page mapping reset
Postpone resetting page->mapping until the final remove_migration_ptes(). Otherwise the expression PageAnon(migration_entry_to_page(entry)) does not work. Signed-off-by: Konstantin Khlebnikov <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a1b58c2 commit 35512ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ void migrate_page_copy(struct page *newpage, struct page *page)
445445
ClearPageSwapCache(page);
446446
ClearPagePrivate(page);
447447
set_page_private(page, 0);
448-
page->mapping = NULL;
449448

450449
/*
451450
* If any waiters have accumulated on the new page then
@@ -667,6 +666,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,
667666
} else {
668667
if (remap_swapcache)
669668
remove_migration_ptes(page, newpage);
669+
page->mapping = NULL;
670670
}
671671

672672
unlock_page(newpage);

0 commit comments

Comments
 (0)