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

From: David Hildenbrand (Arm)

Date: Tue Dec 01 2026 - 05:12:51 EST


On 12/1/26 01:05, Andrew Morton wrote:
> On Mon, 30 Nov 2026 17:18:33 +0000 Yeoreum Yun <yeoreum.yun@xxxxxxx> 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?

This is one relevant bit in the description above:

"This issue was recently reported by Christophe Leroy [1] for ppc32
preventing futher code conversion to ptep_get()/pmdp_get()/... helper
and the same behavior can also be observed on arm64 when built with
2- or 3-level page tables"

--
Cheers,

David