On 7 Nov 2021, at 3:57, Baolin Wang wrote: > As Zi Yan pointed out, the syscall move_pages() can return a non-migrated > number larger than the number of pages the users tried to migrate, when a > THP page is failed to migrate. This is confusing for users. > > Since other migration scenarios do not care about the actual non-migrated > number of pages except the memory compaction migration which will fix in > following patch. Thus we can change the return value to return the number > of {normal page, THP, hugetlb} instead to avoid this issue, and the number > of THP splits will be considered as the number of non-migrated THP, no matter > how many subpages of the THP are migrated successfully. Meanwhile we should > still keep the migration counters using the number of normal pages. > > Co-developed-by: Zi Yan > Signed-off-by: Zi Yan > Signed-off-by: Baolin Wang > --- > mm/migrate.c | 63 +++++++++++++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 47 insertions(+), 16 deletions(-) LGTM. Thanks. Reviewed-by: Zi Yan -- Best Regards, Yan, Zi