All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
@ 2022-05-25 10:26 Baolin Wang
  2022-05-25 13:25 ` Muchun Song
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Baolin Wang @ 2022-05-25 10:26 UTC (permalink / raw)
  To: mike.kravetz, akpm, songmuchun; +Cc: baolin.wang, linux-kernel, linux-mm

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

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
 mm/hugetlb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 7c468ac..3ad49bf 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -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 */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
  2022-05-25 10:26 [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte() Baolin Wang
@ 2022-05-25 13:25 ` Muchun Song
  2022-05-25 17:39 ` Mike Kravetz
  2022-05-26  7:01 ` Anshuman Khandual
  2 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2022-05-25 13:25 UTC (permalink / raw)
  To: Baolin Wang; +Cc: mike.kravetz, akpm, linux-kernel, linux-mm

On Wed, May 25, 2022 at 06:26:24PM +0800, Baolin Wang wrote:
> 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().
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
  2022-05-25 10:26 [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte() Baolin Wang
  2022-05-25 13:25 ` Muchun Song
@ 2022-05-25 17:39 ` Mike Kravetz
  2022-05-26  7:01 ` Anshuman Khandual
  2 siblings, 0 replies; 5+ messages in thread
From: Mike Kravetz @ 2022-05-25 17:39 UTC (permalink / raw)
  To: Baolin Wang, akpm, songmuchun; +Cc: linux-kernel, linux-mm

On 5/25/22 03:26, Baolin Wang wrote:
> 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().
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> ---
>  mm/hugetlb.c | 2 --
>  1 file changed, 2 deletions(-)

Thanks!  I agree that does nothing and should be removed.

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 7c468ac..3ad49bf 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -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 */


-- 
Mike Kravetz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
  2022-05-25 10:26 [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte() Baolin Wang
  2022-05-25 13:25 ` Muchun Song
  2022-05-25 17:39 ` Mike Kravetz
@ 2022-05-26  7:01 ` Anshuman Khandual
  2022-05-27  1:34   ` Baolin Wang
  2 siblings, 1 reply; 5+ messages in thread
From: Anshuman Khandual @ 2022-05-26  7:01 UTC (permalink / raw)
  To: Baolin Wang, mike.kravetz, akpm, songmuchun; +Cc: linux-kernel, linux-mm



On 5/25/22 15:56, Baolin Wang wrote:
> 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()

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

> in hugetlb_mcopy_atomic_pte().
> 
> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>

Otherwise LGTM,

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

> ---
>  mm/hugetlb.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 7c468ac..3ad49bf 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -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 */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte()
  2022-05-26  7:01 ` Anshuman Khandual
@ 2022-05-27  1:34   ` Baolin Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Baolin Wang @ 2022-05-27  1:34 UTC (permalink / raw)
  To: Anshuman Khandual, mike.kravetz, akpm, songmuchun; +Cc: linux-kernel, linux-mm



On 5/26/2022 3:01 PM, Anshuman Khandual wrote:
> 
> 
> On 5/25/22 15:56, Baolin Wang wrote:
>> 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()
> 
> 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

Sure, will remove checkpatch warning in next verion.

> 
>> in hugetlb_mcopy_atomic_pte().
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> 
> Otherwise LGTM,
> 
> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

Thanks. Also thanks to Muchun and Mike for reviewing.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-27  1:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 10:26 [PATCH] mm/hugetlb: Remove unnecessary huge_ptep_set_access_flags() in hugetlb_mcopy_atomic_pte() Baolin Wang
2022-05-25 13:25 ` Muchun Song
2022-05-25 17:39 ` Mike Kravetz
2022-05-26  7:01 ` Anshuman Khandual
2022-05-27  1:34   ` Baolin Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.