Re: [PATCH v5 1/4] mm: Add address apis for ptdescs
From: Vishal Moola (Oracle)
Date: Wed Feb 18 2026 - 15:23:35 EST
On Wed, Feb 11, 2026 at 04:07:54PM -0800, Vishal Moola (Oracle) wrote:
> On Wed, Feb 11, 2026 at 02:18:20PM -0800, Vishal Moola (Oracle) wrote:
> > 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:
> >
> > Hmmm. I meant for it to read "allocate a page table and get its address."
> >
> > > pgtable_alloc()
> > >
> > > that returns a page table pointer, a void*, and:
> >
> > Initially, I intended to name it pgtable_alloc() & pgtable_free(). I saw
> > arm using pgtable_alloc() and powerpc using pgtable_free(), so I looked
> > for another name.
>
> I've done some digging about these names.
> The arm cases uses a function pointer, so we should be able to use that
> name without issue.
Dave, I wanted to follow up on the below question:
> What do you think is a reasonable name for freeing?
>
> pgtable_free() is defined for sparc and powerpc. I could rename them
> prefixed with "__" to get the name since they only have 1-2 internal
> callers.
Matthew brought another question to my attention in this particular
scenario. Should pat/set_memory's alloc_*_page() use pte_alloc_one()
instead of get_zeroed_page()? Is there any reason not to?