Re: [RFC PATCH v4 3/6] mm/migrate: add batch-copy path in migrate_pages_batch

Garg, Shivank
2026-04-03T11:09:53Z

On 3/24/2026 2:12 PM, Huang, Ying wrote:
> Shivank Garg <shivankg@amd.com> writes:
>

>> - LIST_HEAD(unmap_folios);
>> - LIST_HEAD(dst_folios);
>> + unsigned int nr_batch = 0;
>> + bool batch_copied = false;
>> + LIST_HEAD(src_batch);
>> + LIST_HEAD(dst_batch);
>> + LIST_HEAD(src_std);
>> + LIST_HEAD(dst_std);
>
> IMHO, the naming appears too copy centric, how about unmap_batch and
> unmap_single? "unmap" is one step of migration.
>
Makes sense, I'll rename them to unmap_batch/unmap_single/dst_single.

>> bool nosplit = (reason == MR_NUMA_MISPLACED);
>>
>> VM_WARN_ON_ONCE(mode != MIGRATE_ASYNC &&
>> @@ -1943,7 +1956,7 @@ static int migrate_pages_batch(struct list_head *from,
>
> unmap/dst_folios in comments need to be changed too.
>
> rc = migrate_folio_unmap(get_new_folio, put_new_folio,
> private, folio, &dst, mode, ret_folios);
> /*
> * The rules are:
> * 0: folio will be put on unmap_folios list,
> * dst folio put on dst_folios list
> * -EAGAIN: stay on the from list
> * -ENOMEM: stay on the from list
> * Other errno: put on ret_folios list
> */
>
>

yes, will update these comments.

Best regards,
Shivank