Re: [PATCH 3/3] mm: generalize PUD page table allocation

From: David Hildenbrand (Arm)

Date: Mon Oct 26 2026 - 06:53:44 EST


On 10/14/26 05:59, Muchun Song wrote:
> The generic PUD allocator assumes order-0 page tables and zero-valued empty
> entries. MIPS and LoongArch need pud_init() to install their invalid
> entries. MIPS also uses PUD_TABLE_ORDER to describe the allocation size.
>
> Default PUD_TABLE_ORDER to zero, honor architecture overrides, and invoke
> pud_init() from the generic allocator. MIPS and LoongArch can then drop
> their duplicate helpers and use the generic constructor handling and kernel
> ptdesc marking.
>
> This also switches their user PUD allocations from GFP_KERNEL to
> GFP_PGTABLE_USER, so they are accounted to the active memory cgroup
> context. Allocations for init_mm continue to use GFP_PGTABLE_KERNEL.
>
> Assisted-by: LLM
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> ---

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David