mm: Replace READ_ONCE() in pud_trans_unstable()
Subsystems (2)
PATCH 1/1 mm: Replace READ_ONCE() in pud_trans_unstable()
Replace READ_ONCE() with the existing standard page table accessor for PUD aka pudp_get() in pud_trans_unstable(). This does not create any functional change for platforms that do not override pudp_get(), which still defaults to READ_ONCE().
---
This patch applies both on v7.0-rc1 and mm-unstable.
Part of the D128 series but independent. Hence could be considered on its own.
https://lore.kernel.org/all/[email protected]/
include/linux/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pgtable.h +1 -1
@@ -1989,7 +1989,7 @@ static inline int pud_trans_unstable(pud_t *pud) {#if defined(CONFIG_TRANSPARENT_HUGEPAGE ) && \ defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD ) -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);if (pud_none (pudval) ||pud_trans_huge (pudval))return 1 ;
Signature · 1 line
2.30.2
Quoted 5 lines · Anshuman Khandual
Replace
READ_ONCE()with the existing standard page table accessor for PUD akapudp_get()inpud_trans_unstable(). This does not create any functional change for platforms that do not overridepudp_get(), which still defaults toREAD_ONCE().
Quoted 8 lines
Cc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Mike Rapoport <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
Signature · 3 lines
Cheers, David
Quoted 5 lines · On Fri, 27 Feb 2026 04:03:00 +0000 Anshuman Khandual…
Replace
READ_ONCE()with the existing standard page table accessor for PUD akapudp_get()inpud_trans_unstable(). This does not create any functional change for platforms that do not overridepudp_get(), which still defaults toREAD_ONCE().
Quoted 7 lines
Cc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Mike Rapoport <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Thanks,
SJ
[...]
Quoted 5 lines · Anshuman Khandual
Replace
READ_ONCE()with the existing standard page table accessor for PUD akapudp_get()inpud_trans_unstable(). This does not create any functional change for platforms that do not overridepudp_get(), which still defaults toREAD_ONCE().
Quoted 7 lines
Cc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Mike Rapoport <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
LGTM so:
Quoted 26 lines
---
This patch applies both on v7.0-rc1 and mm-unstable.Part of the D128 series but independent. Hence could be considered on its own.
https://lore.kernel.org/all/[email protected]/
include/linux/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/pgtable.h +1
-2@@ -1989,7 +1989,7 @@ static inline int pud_trans_unstable(pud_t *pud) {#if defined(CONFIG_TRANSPARENT_HUGEPAGE ) && \ defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD ) -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);if (pud_none (pudval) ||pud_trans_huge (pudval))return 1 ; --2.30.2