mm: use proper PTE accessor in move_ptes()
Subsystems (2)
PATCH 1/1 mm: use proper PTE accessor in move_ptes()
Follow the pattern established by commit c33c794828f2 ("mm: ptep_get() conversion") and use the proper PTE accessor instead of a direct pointer dereference.
--- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mremap.c +1 -1
@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes *PAGE_SIZE , new_ptep += nr_ptes, new_addr += nr_ptes *PAGE_SIZE ) { -VM_WARN_ON_ONCE (!pte_none (*new_ptep)); +VM_WARN_ON_ONCE (!pte_none (ptep_get (new_ptep))); nr_ptes =1 ; max_nr_ptes = (old_end - old_addr) >>PAGE_SHIFT ;
Signature · 1 line
2.53.0
Quoted 15 lines · Alexander Gordeev
Follow the pattern established by commit
c33c794828f2("mm:ptep_get()conversion") and use the proper PTE accessor instead of a direct pointer dereference.Fixes b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes")Signed-off-by Alexander Gordeev <[email protected]>--- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/mremap.c +0
-0
mm/mremap.c static int move_ptes(struct pagetable_move_control *pmc, · line 267
Quoted 5 lines
mm/mremap.c +1
-1@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes *PAGE_SIZE , new_ptep += nr_ptes, new_addr += nr_ptes *PAGE_SIZE ) { -VM_WARN_ON_ONCE (!pte_none (*new_ptep)); +VM_WARN_ON_ONCE (!pte_none (ptep_get (new_ptep)));
I'd the same patch in my RFC branch. Hence:
Quoted 3 lines
mm/mremap.c +0
-0nr_ptes =1 ; max_nr_ptes = (old_end - old_addr) >>PAGE_SHIFT ;
Quoted 15 lines · Alexander Gordeev
Follow the pattern established by commit
c33c794828f2("mm:ptep_get()conversion") and use the proper PTE accessor instead of a direct pointer dereference.Fixes b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes")Signed-off-by Alexander Gordeev <[email protected]>--- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/mremap.c +0
-0
mm/mremap.c static int move_ptes(struct pagetable_move_control *pmc, · line 270
Quoted 8 lines
mm/mremap.c +1
-1@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes *PAGE_SIZE , new_ptep += nr_ptes, new_addr += nr_ptes *PAGE_SIZE ) { -VM_WARN_ON_ONCE (!pte_none (*new_ptep)); +VM_WARN_ON_ONCE (!pte_none (ptep_get (new_ptep))); nr_ptes =1 ; max_nr_ptes = (old_end - old_addr) >>PAGE_SHIFT ;
Signature · 3 lines
Cheers, David
Quoted 22 lines · David Hildenbrand (Arm)
Quoted 21 lines · Alexander Gordeev
Follow the pattern established by commit
c33c794828f2("mm:ptep_get()conversion") and use the proper PTE accessor instead of a direct pointer dereference.Fixes b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes")Signed-off-by Alexander Gordeev <[email protected]>--- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/mremap.c +1
-1@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes *PAGE_SIZE , new_ptep += nr_ptes, new_addr += nr_ptes *PAGE_SIZE ) { -VM_WARN_ON_ONCE (!pte_none (*new_ptep)); +VM_WARN_ON_ONCE (!pte_none (ptep_get (new_ptep)));
Quoted 5 lines
mm/mremap.c static int move_ptes(struct pagetable_move_control *pmc, · line 270
Quoted 2 lines
mm/mremap.c +0
-0nr_ptes =1 ; max_nr_ptes = (old_end - old_addr) >>PAGE_SHIFT ;
Ah, but I think we should drop the Fixes: tag, or am I missing something?
Signature · 3 lines
Cheers, David
Quoted 23 lines · David Hildenbrand (Arm)
Quoted 22 lines · David Hildenbrand (Arm)
Quoted 21 lines · Alexander Gordeev
Follow the pattern established by commit
c33c794828f2("mm:ptep_get()conversion") and use the proper PTE accessor instead of a direct pointer dereference.Fixes b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes")Signed-off-by Alexander Gordeev <[email protected]>--- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/mremap.c +1
-1@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes *PAGE_SIZE , new_ptep += nr_ptes, new_addr += nr_ptes *PAGE_SIZE ) { -VM_WARN_ON_ONCE (!pte_none (*new_ptep)); +VM_WARN_ON_ONCE (!pte_none (ptep_get (new_ptep)));
Quoted 7 lines
Quoted 5 lines
mm/mremap.c static int move_ptes(struct pagetable_move_control *pmc, · line 270
Quoted 2 lines
mm/mremap.c +0
-0nr_ptes =1 ; max_nr_ptes = (old_end - old_addr) >>PAGE_SHIFT ;Ah, but I think we should drop the Fixes: tag, or am I missing something?
No, you do not. I confused it with ptep_get_lockless(), so no bugfix here. Should I send v2?
Quoted 4 lines
Signature · 3 lines
Cheers, David
Thanks!
Quoted 10 lines · Alexander Gordeev
Quoted 6 lines · David Hildenbrand (Arm)
Quoted 3 lines · David Hildenbrand (Arm)
Ah, but I think we should drop the Fixes: tag, or am I missing something?
No, you do not. I confused it with
ptep_get_lockless(), so no bugfix here. Should I send v2?
I assume Andrew would fixup when applying.
But looks like you missed to CC him? So better send a v1 to make his life easier.
Signature · 3 lines
Cheers, David