Re: [PATCH 1/3] mm: migrate: Fix the return value of migrate_pages()

From: Zi Yan
Date: Tue Nov 09 2021 - 13:10:17 EST


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 <ziy@xxxxxxxxxx>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
> ---
> mm/migrate.c | 63 +++++++++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 47 insertions(+), 16 deletions(-)

LGTM. Thanks. Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>

--
Best Regards,
Yan, Zi

Attachment: signature.asc
Description: OpenPGP digital signature