From: Ze Zuo zuoze1@huawei.com
the THP numa fault actually prevents from migrating shared THP (mapped by multiple processes), so bail out early if mapcount is > 1 to keep the behavior.
Signed-off-by: Ze Zuo zuoze1@huawei.com --- mm/migrate.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/mm/migrate.c b/mm/migrate.c index 4c2a1d99db53..e71683eaa8b5 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2107,6 +2107,10 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page)
VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page), page);
+ /* Do not migrate THP mapped by multiple processes */ + if (PageTransHuge(page) && total_mapcount(page) > 1) + return 0; + /* Avoid migrating to a node that is nearly full */ if (!migrate_balanced_pgdat(pgdat, compound_nr(page))) return 0;