[RFC PATCH] mm/page_alloc: Add PCP list for THP CMA
Vlastimil Babka
vbabka at suse.cz
Tue Aug 5 14:09:12 PDT 2025
On 8/5/25 19:12, Juan Yescas wrote:
> On Tue, Aug 5, 2025 at 2:52 AM Vlastimil Babka <vbabka at suse.cz> wrote:
>>
>> >
>> > Thanks David for the quick overview.
>> >
>> >> I still have no clue what this patch here tried to solve: it doesn't
>> >> make any sense.
>> >>
>> >
>> > The story started with this out of tree patch that is part of Android.
>> >
>> > https://lore.kernel.org/lkml/cover.1604282969.git.cgoldswo@codeaurora.org/T/#u
>> >
>> > This patch introduced the __GFP_CMA flag that allocates pages from
>> > MIGRATE_MOVABLE
>> > or MIGRATE_CMA.
>>
>> What kinds of allocations would then use __GFP_CMA?
>
> The __GFP_CMA allocations are used to allocate userspace anonymous memory. This
> was done initially in the alloc_zeroed_user_highpage_movable()
> function, now it is done
> in vma_alloc_zeroed_movable_folio().
So that means you perceive the risk of anonymous memory being temporarily
pinned and thwarting a alloc_contig_pages() device CMA allocation lower than
for file pages? The pinning can be a gup(), or a compaction migrating the
page, etc...
More information about the Linux-mediatek
mailing list