Re: [RFC PATCH v6 2/5] mm: migrate: Add migrate_misplaced_folios_batch()

Bharata B Rao
2026-04-22T04:16:23Z

On 22-Apr-26 9:34 AM, Donet Tom wrote:
> Hi Gregory
>
> On 4/22/26 9:07 AM, Gregory Price wrote:
>> On Wed, Apr 22, 2026 at 08:56:59AM +0530, Bharata B Rao wrote:
>>> On 21-Apr-26 9:35 PM, Gregory Price wrote:
>>>> On Tue, Apr 21, 2026 at 08:55:02PM +0530, Donet Tom wrote:
>>>>>> +/**
>>>>>> + * migrate_misplaced_folios_batch() - Batch variant of
>>>>>> migrate_misplaced_folio
>>>>>> + * Attempts to migrate a folio list to the specified destination.
>>>>>> + * @folio_list: Isolated list of folios to be batch-migrated.
>>>>>> + * @node: The NUMA node ID to where the folios should be migrated.
>>>>>> + *
>>>>>> + * Caller is expected to have isolated the folios by calling
>>>>>> + * migrate_misplaced_folio_prepare(), which will result in an
>>>>>> + * elevated reference count on the folio. All the isolated folios
>>>>>> + * in the list must belong to the same memcg so that NUMA_PAGE_MIGRATE
>>>>>> + * stat can be attributed correctly to the memcg.
>>> ^ This is the expectation from the caller. pghot caller ensures this.
>>> I could add a debug check in this routine to verify if that is indeed so.
>>>
>> Wondering if the interface name should somehow reflect this as well, to
>> make it a bit clearer.
>
> I agree—this would make the interface clearer.

Sure, will change.

Regards,
Bharata.