From: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
Dave Hansen <dave.hansen@linux.intel.com>,
akpm@linux-foundation.org,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Dave Hansen <dave.hansen@intel.com>
Subject: Re: [PATCH v4 1/4] mm: Add address apis for ptdescs
Date: Sat, 7 Feb 2026 02:25:20 -0800 [thread overview]
Message-ID: <aYcTEFK3D3LDVUPR@fedora> (raw)
In-Reply-To: <aYbtkpls3VEVUhh3@kernel.org>
On Sat, Feb 07, 2026 at 09:45:22AM +0200, Mike Rapoport wrote:
> 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@intel.com>
> > Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.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.
Agreed, I'll change that in the next version.
I had misread an s390 function that expects an (unsigned long *) and assumed
some callers might want the unsigned long, thinking we'd have to cast anyway.
After taking a closer look I see now that every single caller actually
expects a pointer.
next prev parent reply other threads:[~2026-02-07 10:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 1:35 [PATCH v4 0/4] Convert 64-bit x86/mm/pat to ptdescs Vishal Moola (Oracle)
2026-02-05 1:35 ` [PATCH v4 1/4] mm: Add address apis for ptdescs Vishal Moola (Oracle)
2026-02-07 7:45 ` Mike Rapoport
2026-02-07 10:25 ` Vishal Moola (Oracle) [this message]
2026-02-05 1:35 ` [PATCH v4 2/4] x86/mm/pat: Convert pte code to use ptdescs Vishal Moola (Oracle)
2026-02-05 1:35 ` [PATCH v4 3/4] x86/mm/pat: Convert pmd " Vishal Moola (Oracle)
2026-02-05 1:35 ` [PATCH v4 4/4] x86/mm/pat: Convert split_large_page() " Vishal Moola (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYcTEFK3D3LDVUPR@fedora \
--to=vishal.moola@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.