mm/dirty: Replace READ_ONCE() with pudp_get()
Subsystems (2)
PATCH 1/1 mm/dirty: Replace READ_ONCE() with pudp_get()
Replace READ_ONCE() with a standard page table accessor i.e pudp_get() that anyways defaults into READ_ONCE() in cases where platform does not override
--- mm/mapping_dirty_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mapping_dirty_helpers.c +1 -1
@@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, struct mm_walk *walk) {#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);/* Do not split a huge pud */ if (pud_trans_huge (pudval)) {
Signature · 1 line
2.30.2
Quoted 17 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideCc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>--- mm/mapping_dirty_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/mapping_dirty_helpers.c +0
-0
mm/mapping_dirty_helpers.c static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, · line 155
Quoted 8 lines
mm/mapping_dirty_helpers.c +1
-1@@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, struct mm_walk *walk) {#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);/* Do not split a huge pud */ if (pud_trans_huge (pudval)) {
Talking about mm, why not also make changes for these READ_ONCE accesses in gup, hmm, memory, mprotect, sparse-vmemmap?
Quoted 14 lines · Dev Jain
Quoted 12 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideCc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
mm/mapping_dirty_helpers.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
mm/mapping_dirty_helpers.c static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, · line 154
Quoted 12 lines
mm/mapping_dirty_helpers.c +1
-1@@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, struct mm_walk *walk) { #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD - pud_t pudval = READ_ONCE(*pud); + pud_t pudval = pudp_get(pud); /* Do not split a huge pud */ if (pud_trans_huge(pudval)) {Talking about mm, why not also make changes for these
READ_ONCEaccesses in gup, hmm, memory, mprotect, sparse-vmemmap?
Right, could replace all mm/ READ_ONCE() for pxdp pointers with the pgtable helpers but that will create too much code churn in a single patch. Thought of doing these replacements per file will be much more contained which is easy both for review and testing.
Quoted 8 lines · Anshuman Khandual
Quoted 4 lines · Dev Jain
Quoted 2 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not override
Nice cleanup!
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Cc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>--- mm/mapping_dirty_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
mm/mapping_dirty_helpers.c +0
-0@@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, struct mm_walk *walk) {Quoted 8 lines
mm/mapping_dirty_helpers.c static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, · line 155
Quoted 5 lines
mm/mapping_dirty_helpers.c +1
-1#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);/* Do not split a huge pud */ if (pud_trans_huge (pudval)) {Talking about mm, why not also make changes for these
READ_ONCEaccesses in gup, hmm, memory, mprotect, sparse-vmemmap?
Yep, I agree with Dev on that one. Because the change is assumed to be a no-op on all architectures for now, right?
Quoted 6 lines
Quoted 1 line
Right, could replace all
mm/READ_ONCE()for pxdp pointers with the pgtable helpers but that will create too much code churn in a single patch. Thought of doing these replacements per file will be much more contained which is easy both for review and testing.
Emm... as pointed out by Dev, it would get the entire cleanup done in one go, avoiding the churn of multiple small patches ;)
Cheers,
Lance
Quoted 44 lines · Lance Yang
Quoted 8 lines · Anshuman Khandual
Quoted 4 lines · Dev Jain
Quoted 2 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideNice cleanup!
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Cc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>--- mm/mapping_dirty_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
mm/mapping_dirty_helpers.c +0
-0@@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, struct mm_walk *walk) {Quoted 8 lines
mm/mapping_dirty_helpers.c static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end, · line 155
Quoted 5 lines
mm/mapping_dirty_helpers.c +1
-1#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD -pud_t pudval =READ_ONCE (*pud); +pud_t pudval =pudp_get (pud);/* Do not split a huge pud */ if (pud_trans_huge (pudval)) {Talking about mm, why not also make changes for these
READ_ONCEaccesses in gup, hmm, memory, mprotect, sparse-vmemmap?Yep, I agree with Dev on that one. Because the change is assumed to be a no-op on all architectures for now, right?
Quoted 2 lines
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Right, could replace all
mm/READ_ONCE()for pxdp pointers with the pgtable helpers but that will create too much code churn in a single patch. Thought of doing these replacements per file will be much more contained which is easy both for review and testing.Emm... as pointed out by Dev, it would get the entire cleanup done in one go, avoiding the churn of multiple small patches ;)
I think I'd prefer smaller patches here. For example, the discussion on the debug PT stuff was quite helpful and probably would just have fallen through the cracks when blindly replacing all READ_ONCE.
Having that said, combining some simple cases across multiple files does not sound too bad either.
Signature · 3 lines
Cheers David / dhildenb
Quoted 9 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideCc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
Signature · 3 lines
Cheers David / dhildenb
Quoted 10 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideCc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>---
Quoted 8 lines · Anshuman Khandual
Replace
READ_ONCE()with a standard page table accessor i.epudp_get()that anyways defaults intoREAD_ONCE()in cases where platform does not overrideCc Andrew Morton <[email protected]>Cc David Hildenbrand <[email protected]>Signed-off-by Anshuman Khandual <[email protected]>
Signature · 2 lines
Oscar Salvador SUSE Labs