[PATCH v3 00/20] mm: change behavior of pXdp_get()/pXd_page() in compile-time folded pgtable

Andrew Morton akpm at linux-foundation.org
Mon Nov 30 16:05:13 PST 2026


On Mon, 30 Nov 2026 17:18:33 +0000 Yeoreum Yun <yeoreum.yun at arm.com> wrote:

> Using ptep_get() and its counterparts in common code is suboptimal on
> kernel configurations with generic compile-time folded page tables.
> By default, ptep_get() and its friends expands to READ_ONCE(),
> forcing the compiler to emit a load even when the value is not used afterwards.
> 

lazy drive-by comment:

>  Documentation/mm/page_tables.rst            | 84 +++++++++++++++++++++++++----
>  arch/arm/include/asm/page-nommu.h           |  4 +-
>  arch/arm/include/asm/pgtable-2level-types.h | 20 +++++--
>  arch/arm/include/asm/pgtable.h              |  2 -
>  arch/arm64/include/asm/pgtable.h            | 23 --------
>  arch/loongarch/include/asm/pgtable.h        |  2 +
>  arch/loongarch/kvm/mmu.c                    | 20 ++++---
>  arch/mips/include/asm/pgtable.h             |  2 +
>  arch/openrisc/include/asm/pgtable.h         |  3 --
>  arch/riscv/kvm/mmu.c                        | 20 ++++---
>  arch/riscv/mm/fault.c                       | 52 +++++++++++-------
>  arch/x86/include/asm/pgtable.h              | 14 +++++
>  arch/x86/kernel/cpu/common.c                |  2 +-
>  arch/x86/kernel/machine_kexec_64.c          |  2 +-
>  arch/x86/mm/dump_pagetables.c               | 18 ++++---
>  arch/x86/mm/init.c                          |  2 +-
>  arch/x86/mm/pat/set_memory.c                |  6 +--
>  include/asm-generic/pgtable-nop4d.h         | 54 +++++++++++++++----
>  include/asm-generic/pgtable-nopmd.h         | 54 +++++++++++++++----
>  include/asm-generic/pgtable-nopud.h         | 56 +++++++++++++++----
>  include/linux/pgtable.h                     | 69 +++++++++++++++++-------
>  21 files changed, 369 insertions(+), 140 deletions(-)

afaict, this series is an unquantified speed/.text improvement?  That's
a lot of churn!  What actual benefit are we getting from it?



More information about the linux-riscv mailing list