mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
Subsystems (2)
PATCH 1/1 mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte().
--- mm/hugetlb.c | 2 -- 1 file changed, 2 deletions(-)
mm/hugetlb.c +0 -2
@@ -6032,8 +6032,6 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,set_huge_pte_at (dst_mm, dst_addr, dst_pte, _dst_pte); - (void )huge_ptep_set_access_flags (dst_vma, dst_addr, dst_pte, _dst_pte, - dst_vma->vm_flags &VM_WRITE );hugetlb_count_add (pages_per_huge_page (h), dst_mm);/* No need to invalidate - it was non-present before */
Signature · 1 line
1.8.3.1
Quoted 6 lines · Baolin Wang
There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by
set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessaryhuge_ptep_set_access_flags()inhugetlb_mcopy_atomic_pte().Signed-off-by Baolin Wang <[email protected]>
Thanks.
Quoted 9 lines · Baolin Wang
There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by
set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessaryhuge_ptep_set_access_flags()inhugetlb_mcopy_atomic_pte().Signed-off-by Baolin Wang <[email protected]>--- mm/hugetlb.c | 2 -- 1 file changed, 2 deletions(-)
Thanks! I agree that does nothing and should be removed.
Quoted 14 lines
mm/hugetlb.c +0
-2@@ -6032,8 +6032,6 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,set_huge_pte_at (dst_mm, dst_addr, dst_pte, _dst_pte); - (void )huge_ptep_set_access_flags (dst_vma, dst_addr, dst_pte, _dst_pte, - dst_vma->vm_flags &VM_WRITE );hugetlb_count_add (pages_per_huge_page (h), dst_mm);/* No need to invalidate - it was non-present before */
Signature · 1 line
Mike Kravetz
Quoted 3 lines · Baolin Wang
There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by
set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessaryhuge_ptep_set_access_flags()
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #9:
value has no changes. Thus remove the unnecessary huge_ptep_set_access_flags()
total: 0 errors, 1 warnings, 8 lines checked
Quoted 3 lines
in
hugetlb_mcopy_atomic_pte().Signed-off-by Baolin Wang <[email protected]>
Otherwise LGTM,
Quoted 17 lines
--- mm/hugetlb.c | 2 -- 1 file changed, 2 deletions(-)mm/hugetlb.c +0
-2@@ -6032,8 +6032,6 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,set_huge_pte_at (dst_mm, dst_addr, dst_pte, _dst_pte); - (void )huge_ptep_set_access_flags (dst_vma, dst_addr, dst_pte, _dst_pte, - dst_vma->vm_flags &VM_WRITE );hugetlb_count_add (pages_per_huge_page (h), dst_mm);/* No need to invalidate - it was non-present before */
Quoted 7 lines · Anshuman Khandual
Quoted 3 lines · Baolin Wang
There is no need to update the hugetlb access flags after just setting the hugetlb page table entry by
set_huge_pte_at(), since the page table entry value has no changes. Thus remove the unnecessaryhuge_ptep_set_access_flags()
Quoted 5 lines
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #9:
value has no changes. Thus remove the unnecessaryhuge_ptep_set_access_flags()total: 0 errors, 1 warnings, 8 lines checked
Sure, will remove checkpatch warning in next verion.
Quoted 8 lines
Quoted 4 lines
in
hugetlb_mcopy_atomic_pte().Signed-off-by Baolin Wang <[email protected]>Otherwise LGTM,
Reviewed-by Anshuman Khandual <[email protected]>
Thanks. Also thanks to Muchun and Mike for reviewing.