Re: [PATCH v4 4/4] mm/page_isolation: remove migratetype parameter from more functions.
From: Zi Yan
Date: Sat May 17 2025 - 20:07:46 EST
On 17 May 2025, at 16:21, Vlastimil Babka wrote:
> On 5/9/25 22:01, Zi Yan wrote:
>> migratetype is no longer overwritten during pageblock isolation,
>> start_isolate_page_range(), has_unmovable_pages(), and
>> set_migratetype_isolate() no longer need which migratetype to restore
>> during isolation failure.
>>
>> For has_unmoable_pages(), it needs to know if the isolation is for CMA
>> allocation, so adding CMA_ALLOCATION to isolation flags to provide the
>> information.
>>
>> alloc_contig_range() no longer needs migratetype. Replace it with
>> a newly defined acr_flags_t to tell if an allocation is for CMA. So does
>> __alloc_contig_migrate_range().
>>
>> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
>
> AFAICS has_unmovable_pages() adds the flags parameter but doesn't use it.
Yes, will remove it.
>
> But also, I think having both mode and flags is just unnecessary complexity
> in this case? CMA_ALLOCATION could be just a new flag? Even if some flag
> combinations wouldn't logicaly make sense, this has only so few users so we
> don't have to care to make them exclusive with the mode thing.
I was doing that until v3.
> Also I think REPORT_FAILURE is only used with MEMORY_OFFLINE so it could be
> squashed?
Yes, let me do that. Johannes also pointed this out but I missed it.
In the next version, I will remove REPORT_FAILURE as it is implied by
MEMORY_OFFLINE, including isolate_flags_t, and keep the existing enum
with MEMORY_OFFLINE and CMA_ALLOCATION.
Thanks for the review.
--
Best Regards,
Yan, Zi