[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYbtkpls3VEVUhh3@kernel.org>
Date: Sat, 7 Feb 2026 09:45:22 +0200
From: Mike Rapoport <rppt@...nel.org>
To: "Vishal Moola (Oracle)" <vishal.moola@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
akpm@...ux-foundation.org,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave.hansen@...el.com>
Subject: Re: [PATCH v4 1/4] mm: Add address apis for ptdescs
Hi Vishal,
On Wed, Feb 04, 2026 at 05:35:24PM -0800, Vishal Moola (Oracle) wrote:
> Architectures frequently only care about the address associated with a
> page table. The current ptdesc api forced callers to acquire a ptdesc to
> use them. Add more apis to abstract ptdescs away from architectures that
> don't need the descriptor.
>
> This patch adds pgtable_alloc() and pgtable_free() to operate on the
> underlying addresses associated with page table descriptors, similar to
> get_free_pages() and free_pages(). The allocations will be zeroed since
> theres no reason to want a page table with stale data.
>
> Suggested-by: Dave Hansen <dave.hansen@...el.com>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@...il.com>
> ---
> include/linux/mm.h | 4 ++++
> mm/memory.c | 34 ++++++++++++++++++++++++++++++++++
> 2 files changed, 38 insertions(+)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index f8a8fd47399c..3f3000567823 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -3419,6 +3419,10 @@ static inline void __pagetable_free(struct ptdesc *pt)
> __free_pages(page, compound_order(page));
> }
>
> +unsigned long pgtable_alloc_addr_noprof(gfp_t gfp, unsigned int order);
Why not void *?
I don't think it should follow ancient get_zeroed_page() and force all
callers to do the casting when they are expecting a pointer anyway.
> +#define pgtable_alloc_addr(...) alloc_hooks(pgtable_alloc_addr_noprof(__VA_ARGS__))
> +void pgtable_free_addr(const void *addr);
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists