Re: [PATCH v2 10/22] mm: introduce freetype_t

From: Vlastimil Babka (SUSE)

Date: Mon May 11 2026 - 13:01:57 EST


On 5/11/26 18:49, Brendan Jackman wrote:
> On Mon May 11, 2026 at 3:34 PM UTC, Vlastimil Babka (SUSE) wrote:
>>> +/**
>>> + * __get_pfnblock_freetype - Return the freetype of a pageblock, optionally
>>> + * ignoring the fact that it's currently isolated.
>>> + * @page: The page within the block of interest
>>> + * @pfn: The target page frame number
>>> + * @ignore_iso: If isolated, return the migratetype that the block had before
>>> + * isolation.
>>> + */
>>> +__always_inline freetype_t
>>
>> 'static' too?
>
> Yup thanks
>
>>
>>> +__get_pfnblock_freetype(const struct page *page, unsigned long pfn,
>>> + bool ignore_iso)
>>> +{
>>> + int mt = get_pfnblock_migratetype(page, pfn);
>>> +
>>> + return migrate_to_freetype(mt, 0);
>>> +}
>>> +
>>> +/**
>>> + * get_pfnblock_migratetype - Return the freetype of a pageblock
>>> + * @page: The page within the block of interest
>>> + * @pfn: The target page frame number
>>> + *
>>> + * Return: The freetype of the pageblock
>>> + */
>>> +__always_inline freetype_t
>>
>> And this is declared in a header so the __always_inline is not really
>> applicable?
>
>> (seems we should fix up get_pfnblock_migratetype too)
>
> Um, I think it probably still forces inlining in calls within the same
> translation unit?

True but I don't think we try to do that consciously, seems like it was just
an oversight for get_pfnblock_migratetype, maybe Zi Yan remembers?

> Anyway I am pretty meh about this, I suspect humans and compilers are
> equally bad at making this decision, I was just trying to be consistent
> with the code it's replacing.

True.