Re: [PATCH RFC v6 3/5] mm/migrate: add copy offload registration infrastructure
From: Huang, Ying
Date: Mon Jul 20 2026 - 07:50:43 EST
Shivank Garg <shivankg@xxxxxxx> writes:
[snip]
> diff --git a/mm/migrate.c b/mm/migrate.c
> index 41b732e78a67..4fed3110ca0a 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -43,6 +43,7 @@
> #include <linux/sched/sysctl.h>
> #include <linux/memory-tiers.h>
> #include <linux/pagewalk.h>
> +#include <linux/migrate_copy_offload.h>
>
> #include <asm/tlbflush.h>
>
> @@ -51,12 +52,6 @@
> #include "internal.h"
> #include "swap.h"
>
> -/* For now, never offload. Wired up in later patch. */
> -static bool migrate_should_offload(int reason)
> -{
> - return false;
> -}
> -
> static const struct movable_operations *offline_movable_ops;
> static const struct movable_operations *zsmalloc_movable_ops;
>
> @@ -2050,7 +2045,7 @@ static int migrate_pages_batch(struct list_head *from,
>
> /* Batch-copy eligible folios before the move phase */
> if (!list_empty(&unmap_batch))
> - migrate_folios_mc_copy(&dst_batch, &unmap_batch, nr_batch);
> + migrate_offload_batch_copy(&dst_batch, &unmap_batch, nr_batch);
>
> retry = 1;
> for (pass = 0; pass < nr_pass && retry; pass++) {
Found a difference between v5 and v6 here. In v5, migrate_pages_batch()
checks the return value of migrate_offload_batch_copy() and acts
accordingly. While in v6, it does not. Why was this changed?
IIUC, FOLIO_CONTENT_COPIED is now used to indicate a copy failure. Is
this necessary? Is it possible that some (but not all) folios fail to
be copied?
[snip]
---
Best Regards,
Huang, Ying