David Hildenbrand <david@xxxxxxxxxx> writes: > On 09.08.24 16:59, Zi Yan wrote: >> do_numa_page() and do_huge_pmd_numa_page() share a lot of common code. To >> reduce redundancy, move common code to numa_migrate_prep() and rename >> the function to numa_migrate_check() to reflect its functionality. >> Now do_huge_pmd_numa_page() also checks shared folios to set >> TNF_SHARED flag. > > Yeah, I was also wondering why we didn't check that in the PMD case. IIUC, before commit 728be28fae8c ("mm: migrate: remove THP mapcount check in numamigrate_isolate_page()"), we don't allow to migrate THP with mapcount > 1. So, it's unnecessary to set TNF_SHARED flag at that time. However, after that commit, we need to do it. -- Best Regards, Huang, Ying