Re: [PATCH 5/7] mm/migrate: add copy offload registration infrastructure

From: Garg, Shivank

Date: Wed May 20 2026 - 12:01:18 EST




On 5/11/2026 9:20 PM, David Hildenbrand (Arm) wrote:
> On 4/28/26 17:50, Shivank Garg wrote:

[...]

>> +static bool migrate_offload_do_batch(int reason)
>> +{
>> + if (!static_branch_unlikely(&migrate_offload_enabled))
>> + return false;
>> +
>> + switch (reason) {
>> + case MR_COMPACTION:
>> + case MR_SYSCALL:
>> + case MR_DEMOTION:
>> + case MR_NUMA_MISPLACED:
>> + return true;
>> + default:
>> + return false;
>
>
> What's the exact reason we don't do this for hotunplug etc? IOW, why do we make
> this depend on a reason?

Reason-based filtering could be a requirement for some users who want only specific
use cases to go through DMA offload.

For the RFC, I introduced a placeholder to enable further discussion on which use cases
should allow migration offload and whether offload users actually need this control?

Your other point also makes sense: "If someone migrates a handful of folios, latency is
likely more important (and batching less beneficial)."
Based on this, we could either fully rely on batch size. I'll think more about this.

Thanks,
Shivank