Re: [PATCH 1/3] s390/mm: Drop all pxdp_get()

From: Anshuman Khandual

Date: Wed Sep 23 2026 - 08:20:31 EST


On Wed, Sep 23, 2026 at 11:16:29AM +0200, Heiko Carstens wrote:
> On Wed, Sep 23, 2026 at 10:02:20AM +0530, Anshuman Khandual wrote:
> > Current platform specific pxdp_get() helpers are exact same as the default
> > ones defined in the generic MM header (include/linux/pgtable.h) thus making
> > them redundant. Just add required forward declarations.
> >
> > Cc: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> > Cc: Gerald Schaefer <gerald.schaefer@xxxxxxxxxxxxx>
> > Cc: linux-s390@xxxxxxxxxxxxxxx
> > Cc: linux-kernel@xxxxxxxxxxxxxxx
> > Cc: linux-mm@xxxxxxxxx
> > Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> > ---
> > arch/s390/include/asm/pgtable.h | 35 +++++----------------------------
> > 1 file changed, 5 insertions(+), 30 deletions(-)
> >
> > diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
> > index e882663a58e77..0a0b0ec42b624 100644
> > --- a/arch/s390/include/asm/pgtable.h
> > +++ b/arch/s390/include/asm/pgtable.h
> > @@ -25,6 +25,11 @@
> > #include <asm/page.h>
> > #include <asm/uv.h>
> >
> > +static inline pte_t ptep_get(const pte_t *ptep);
> > +static inline pud_t pudp_get(const pud_t *pudp);
> > +static inline p4d_t p4dp_get(const p4d_t *p4dp);
> > +static inline pgd_t pgdp_get(const pgd_t *pgdp);
> > +
> > extern pgd_t swapper_pg_dir[];
> > extern pgd_t invalid_pg_dir[];
> > extern void paging_init(void);
> > @@ -985,36 +990,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
> > WRITE_ONCE(*ptep, pte);
> > }
> >
> > -#define ptep_get ptep_get
> > -static inline pte_t ptep_get(pte_t *ptep)
> > -{
> > - return READ_ONCE(*ptep);
> > -}
>
> As reported by Sashiko, this results in a compile error due to conflicting
> types; but I don't see too much value with this patch if a forward declaration
> of the common code implementation needs to be added instead. Looks like s390
> would be the only architecture which would have that.

We could move pxdp_get() caller functions from this header inside C files
like other platform changes proposed here. Would that be better instead ?

>
> Besides that the s390 implementation of ptep_get() will be filled with
> more content "soon", when Alexander's lazy mmu work will be merged.

Hmm, okay. I don't have strong opinion either way.