[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFgf54pFzyAj5MKBx8xcuME-BGGWS1ZZLkw5vSgN8sGPftq88A@mail.gmail.com>
Date: Mon, 19 Jan 2026 15:55:41 +0000
From: Mostafa Saleh <smostafa@...gle.com>
To: Jörg Rödel <joro@...tes.org>
Cc: linux-mm@...ck.org, iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, corbet@....net, will@...nel.org,
robin.murphy@....com, akpm@...ux-foundation.org, vbabka@...e.cz,
surenb@...gle.com, mhocko@...e.com, jackmanb@...gle.com, hannes@...xchg.org,
ziy@...dia.com, david@...hat.com, lorenzo.stoakes@...cle.com,
Liam.Howlett@...cle.com, rppt@...nel.org, xiaqinxin@...wei.com,
baolu.lu@...ux.intel.com, rdunlap@...radead.org
Subject: Re: [PATCH 1/2] mm/page_ext: Add page_ext_get_phys()
On Mon, Jan 19, 2026 at 3:49 PM Jörg Rödel <joro@...tes.org> wrote:
>
> On Mon, Jan 19, 2026 at 02:22:45PM +0000, Mostafa Saleh wrote:
> > +static inline struct page_ext *page_ext_get_phys(phys_addr_t phys)
>
> The name is misleading as it indicates that the function returns a physical
> address. Maybe name it page_ext_from_phys()?
I will update it.
>
> > +{
> > + return NULL;
> > +}
> > +
> > static inline void page_ext_put(struct page_ext *page_ext)
> > {
> > }
> > diff --git a/mm/page_ext.c b/mm/page_ext.c
> > index 297e4cd8ce90..5fe65a0ac4f3 100644
> > --- a/mm/page_ext.c
> > +++ b/mm/page_ext.c
> > @@ -538,6 +538,29 @@ struct page_ext *page_ext_get(const struct page *page)
> > return page_ext;
> > }
> >
> > +/**
> > + * page_ext_get_phys() - Get the page_ext structure for a physical address.
> > + * @phys: The physical address to query.
> > + *
> > + * This function safely gets the `struct page_ext` associated with a given
> > + * physical address. It performs validation to ensure the address corresponds
> > + * to a valid, online struct page before attempting to access it.
> > + * It should return NULL for (MMIO, ZONE_DEVICE, holes, offline memory)
>
> It should?
>
Yes, I can make it more definitive as "it returns"
Thanks,
Mostafa
> -Joerg
Powered by blists - more mailing lists