Re: [PATCH v3 21/26] mm/page_alloc: implement FREETYPE_UNMAPPED allocations

"Brendan Jackman" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.mm
Message-ID <[email protected]>
On Mon Aug 3, 2026 at 10:18 AM BST, Vlastimil Babka (SUSE) wrote:
>> +/*
>> + * Can pages of these two freetypes be combined into a single higher-order free
>> + * page?
>> + */
>> +static inline bool can_merge_freetypes(freetype_t a, freetype_t b)
>> +{
>> +	if (freetypes_equal(a, b))
>> +		return true;
>> +
>> +	if (!migratetype_is_mergeable(free_to_migratetype(a)) ||
>> +	    !migratetype_is_mergeable(free_to_migratetype(b)))
>> +		return false;
>> +
>> +	/*
>> +	 * Mustn't "just" merge pages with different freetype flags, changing
>> +	 * those requires updating pagetables.
>> +	 */
>> +	return freetype_flags(a) == freetype_flags(b);
>> +}
>> +
>>  /*
>>   * Freeing function for a buddy system allocator.
>>   *
>> @@ -1069,9 +1090,7 @@ static inline void __free_one_page(struct page *page,
>>  			buddy_ft = get_pfnblock_freetype(buddy, buddy_pfn);
>>  			buddy_mt = free_to_migratetype(buddy_ft);
>
> There's a comment above this that should probably be moved to
> can_merge_freetypes() as well?

True, thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.