Re: [PATCH v5 1/4] mm: Add address apis for ptdescs

From: Matthew Wilcox

Date: Wed Feb 11 2026 - 16:54:36 EST


On Wed, Feb 11, 2026 at 12:13:10PM -0800, Dave Hansen wrote:
> On 2/11/26 11:52, Vishal Moola (Oracle) wrote:
> > +/**
> > + * pgtable_alloc_addr - Allocate pagetables to get an address
> > + * @gfp: GFP flags
> > + * @order: desired pagetable order
>
> FWIW, I don't like how pgtable_alloc_addr() looks in practice. It reads
> like it is: "allocate a page table address", not "allocate a page
> table". I don't have a better suggestion other than having:
>
> pgtable_alloc()
>
> that returns a page table pointer, a void*, and:
>
> ptdesc_alloc()
>
> which returns a ptdesc*. But I suspect that would get confusing at the
> point that ptdescs _themselves_ start getting allocated.

I think that's fine and consistent with folio_alloc(). Internally to
ptdesc_alloc(), it'll use a kmem_cache_alloc(), so there won't be
any confusion.