Skip to contentSkip to conversation

mm: Replace READ_ONCE() in pud_trans_unstable()

PATCH Applied Anshuman Khandual 4 participants 4 messages Feb 27 – Mar 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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().

Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mike Rapoport <[email protected]>

---
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
index a50df42a893f..d4826447bc93 100644
@@ -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
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Anshuman Khandual

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().

Quoted 8 lines
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mike Rapoport <[email protected]>

---

Signature · 3 lines
Cheers,

David
Acked-by on v1 1/1
#2 lore raw
In reply to Anshuman Khandual
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 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().

Quoted 7 lines
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mike Rapoport <[email protected]>

Thanks,
SJ

[...]

Reviewed-by on v1 1/1
#3 lore raw
In reply to Anshuman Khandual
Quoted 5 lines · Anshuman Khandual

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().

Quoted 7 lines
Cc Andrew Morton <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mike Rapoport <[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
index a50df42a893f..d4826447bc93 100644
@@ -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