Re: [RFC PATCH] mm/page_alloc: Add PCP list for THP CMA

From: David Hildenbrand
Date: Tue Jul 29 2025 - 08:42:34 EST


On 29.07.25 14:30, akash.tyagi wrote:
On Fri, 25 Jul 2025 at 10:27, Zi Yan <ziy@xxxxxxxxxx> wrote:
But there is this known problem that CMA can fail temporarily due to
short-term pinnings. See the "reliable CMA" work (don't remember the exact name).
I think you mean Guaranteed CMA[1].

[1] https://lore.kernel.org/linux-mm/CAJuCfpEWVEqsivd7oTvp4foEho_HaD1XNP8KTeKWzG_X2skfGQ@xxxxxxxxxxxxxx/

Best Regards,
Yan, Zi


Hi,

Yes, the issue I described is actually related to Guaranteed CMA[1].

I have rewritten our problem statement to address concerns more specifically related to the Android common kernels.

Problem statement:
Android Common kernels usually have an out-of-tree patch to prevent file-backed page allocated from CMA.
It allows some allocations which have lower chance of being pinned to use CMA to improve CMA utilization controlled by a flag __GFP_CMA.
https://lore.kernel.org/lkml/cover.1604282969.git.cgoldswo@xxxxxxxxxxxxxx/


Additionally, android kernels create cma pcp list for pages less than PAGE_ALLOC_COSTLY_ORDER, but not for THP pages.

I'm afraid you have to fix this in the android kernels.

--
Cheers,

David / dhildenb