Re: [PATCH v4 00/20] mm: change behavior of pXdp_get()/pXd_page() in compile-time folded pgtable
From: David Hildenbrand (Arm)
Date: Fri Dec 04 2026 - 07:20:49 EST
On Tue, 01 Dec 2026 17:07:02 +0000, Yeoreum Yun 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 expand to READ_ONCE(),
> forcing the compiler to emit a load even when the value is not used afterwards.
>
> This issue was recently reported by Christophe Leroy [1] for ppc32
> preventing further 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
>
> [...]
Applied, thanks!
I fixed up some more patch descriptions:
- * #1: fixed the subject (p4d|pud|pmd) and the Fixes: tag
- * #10: fixed a typo in the subject
- * #12: fixed two typos
- * #16: minor wording tweaks
- * #17: fixed the example (pmd_offset()) and a typo
- * Only kept the link to Christophe's report in #16
@Levi, your SoB was missing on the patches from Dave and me that you sent
(#1-#7, #12, #15-#17, #20), so I added it.
Please shout if you disagree.
tree: mm/core.git
branch: core-7.5.folded
Applied patches will appear soon in mm-next, followed by linux-next.
Please report any outstanding bugs that were missed during review, so we
can either drop the patch series or decide how to fix it up.
It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even
though the patches have already been applied. If possible, patch trailers
will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. Further, this is not a guarantee that the
patches will go upstream. If in doubt, please check the listed branch.
[01/20] mm/pgtable: define (pgd|p4d|pud)_offset_lockless() for folded page tables
https://git.kernel.org/mm/core/c/76a63570
[02/20] ARM: mm: make nommu pgd_t a scalar
https://git.kernel.org/mm/core/c/de21e5a2
[03/20] ARM: mm: make 2-level pgd_t a scalar
https://git.kernel.org/mm/core/c/88243a1d
[04/20] ARM: mm: remove custom pgdp_get()
https://git.kernel.org/mm/core/c/871f447e
[05/20] LoongArch: mm: define pud_leaf() only when PUD exists
https://git.kernel.org/mm/core/c/28d67fd4
[06/20] MIPS: mm: define pud_leaf() only when PUD exists
https://git.kernel.org/mm/core/c/c6d9c3be
[07/20] mm/pgtable: define (pgd|p4d|pud)_leaf() for folded page tables
https://git.kernel.org/mm/core/c/e051d1ab
[08/20] LoongArch: KVM: Don't pass stack copies of pXd to pXd_offset()
https://git.kernel.org/mm/core/c/fcb4277a
[09/20] RISC-V: KVM: Don't pass stack copies of pXd to pXd_offset()
https://git.kernel.org/mm/core/c/9e6637be
[10/20] RISC-V: mm: use proper set_pXd() for generic compile-time folded patable in vmalloc_fault()
https://git.kernel.org/mm/core/c/f78ab32f
[11/20] mm/pgtable: redefine PGTABLE_LEVEL enum with ascending order from PGD
https://git.kernel.org/mm/core/c/d12f330b
[12/20] x86/mm: Introduce helper for checking direct map 1G page support
https://git.kernel.org/mm/core/c/30c870af
[13/20] x86/mm: Use pgtable_level enum in effective_prot_pXd()
https://git.kernel.org/mm/core/c/88b129b3
[14/20] x86/mm: Carve out the generic compile-time folded pgtable case in effective_prot()
https://git.kernel.org/mm/core/c/eabd8260
[15/20] openrisc: mm: drop __pmd_offset()
https://git.kernel.org/mm/core/c/356d139f
[16/20] mm/pgtable: optimize pmdp_get() and friends for folded pagetable levels
https://git.kernel.org/mm/core/c/5a5dc605
[17/20] mm/pgtable: catch abuse of folded dummy pgd_t/p4d_t/pud_t
https://git.kernel.org/mm/core/c/60d391ea
[18/20] mm/pgtable: disallow pXd_page() and friends with folded dummy values
https://git.kernel.org/mm/core/c/88b2b135
[19/20] mm/pgtable: disallow calling folded set_pgd/set_p4d/set_pud with dummy
https://git.kernel.org/mm/core/c/7f1e5a45
[20/20] Documentation: mm: clarify behaviour of compile-time folded page tables
https://git.kernel.org/mm/core/c/7bd327d2
--
Cheers,
David