mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-06 17:39:01 +01:00
mm: numa: Copy cpupid on page migration
After page migration, the new page has the nidpid unset. This makes every fault on a recently migrated page look like a first numa fault, leading to another page migration. Copying over the nidpid at page migration time should prevent erroneous migrations of recently migrated pages. Signed-off-by: Rik van Riel <[email protected]> Signed-off-by: Mel Gorman <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Srikar Dronamraju <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
e29cf08b05
commit
7851a45cd3
1 file changed
+9
@@ -443,6 +443,8 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
|
||||
*/
|
||||
void migrate_page_copy(struct page *newpage, struct page *page)
|
||||
{
|
||||
int cpupid;
|
||||
|
||||
if (PageHuge(page) || PageTransHuge(page))
|
||||
copy_huge_page(newpage, page);
|
||||
else
|
||||
@@ -479,6 +481,13 @@ void migrate_page_copy(struct page *newpage, struct page *page)
|
||||
__set_page_dirty_nobuffers(newpage);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy NUMA information to the new page, to prevent over-eager
|
||||
* future migrations of this same page.
|
||||
*/
|
||||
cpupid = page_cpupid_xchg_last(page, -1);
|
||||
page_cpupid_xchg_last(newpage, cpupid);
|
||||
|
||||
mlock_migrate_page(newpage, page);
|
||||
ksm_migrate_page(newpage, page);
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user