linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range()
@ 2022-08-22  8:25 Lukas Bulwahn
  2022-08-22  8:51 ` Miaohe Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Bulwahn @ 2022-08-22  8:25 UTC (permalink / raw)
  To: Miaohe Lin, Mike Kravetz, Muchun Song, Andrew Morton, linux-mm
  Cc: kernel-janitors, linux-kernel, Lukas Bulwahn

Commit a0e4f7b82610 ("mm/hugetlb: make detecting shared pte more reliable")
modifies copy_hugetlb_page_range() such that huge_ptep_get(dst_pte) and the
local variable dst_entry is not used explicitly in this function.

Remove this unused local variable dst_entry in copy_hugetlb_page_range().
No functional change.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
 mm/hugetlb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9a72499486c1..6c00ba1dde32 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4763,7 +4763,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 			    struct vm_area_struct *dst_vma,
 			    struct vm_area_struct *src_vma)
 {
-	pte_t *src_pte, *dst_pte, entry, dst_entry;
+	pte_t *src_pte, *dst_pte, entry;
 	struct page *ptepage;
 	unsigned long addr;
 	bool cow = is_cow_mapping(src_vma->vm_flags);
@@ -4823,7 +4823,6 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 		src_ptl = huge_pte_lockptr(h, src, src_pte);
 		spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
 		entry = huge_ptep_get(src_pte);
-		dst_entry = huge_ptep_get(dst_pte);
 again:
 		if (huge_pte_none(entry)) {
 			/*
@@ -4906,7 +4905,7 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 					restore_reserve_on_error(h, dst_vma, addr,
 								new);
 					put_page(new);
-					/* dst_entry won't change as in child */
+					/* huge_ptep of dst_pte won't change as in child */
 					goto again;
 				}
 				hugetlb_install_page(dst_vma, dst_pte, addr, new);
-- 
2.17.1


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

* Re: [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range()
  2022-08-22  8:25 [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range() Lukas Bulwahn
@ 2022-08-22  8:51 ` Miaohe Lin
  2022-08-22  9:05   ` Lukas Bulwahn
  0 siblings, 1 reply; 4+ messages in thread
From: Miaohe Lin @ 2022-08-22  8:51 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: kernel-janitors, linux-kernel, Mike Kravetz, Muchun Song,
	Andrew Morton, Linux-MM

On 2022/8/22 16:25, Lukas Bulwahn wrote:
> Commit a0e4f7b82610 ("mm/hugetlb: make detecting shared pte more reliable")
> modifies copy_hugetlb_page_range() such that huge_ptep_get(dst_pte) and the
> local variable dst_entry is not used explicitly in this function.
> 
> Remove this unused local variable dst_entry in copy_hugetlb_page_range().
> No functional change.
> 
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

LGTM. Thanks for your patch.

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

BTW: I will send a v2 of that series soon. So the above commit id might change.

Thanks,
Miaohe Lin


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

* Re: [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range()
  2022-08-22  8:51 ` Miaohe Lin
@ 2022-08-22  9:05   ` Lukas Bulwahn
  2022-08-22  9:21     ` Miaohe Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Bulwahn @ 2022-08-22  9:05 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: kernel-janitors, Linux Kernel Mailing List, Mike Kravetz,
	Muchun Song, Andrew Morton, Linux-MM

On Mon, Aug 22, 2022 at 10:51 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> On 2022/8/22 16:25, Lukas Bulwahn wrote:
> > Commit a0e4f7b82610 ("mm/hugetlb: make detecting shared pte more reliable")
> > modifies copy_hugetlb_page_range() such that huge_ptep_get(dst_pte) and the
> > local variable dst_entry is not used explicitly in this function.
> >
> > Remove this unused local variable dst_entry in copy_hugetlb_page_range().
> > No functional change.
> >
> > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
>
> LGTM. Thanks for your patch.
>
> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
>
> BTW: I will send a v2 of that series soon. So the above commit id might change.
>

Feel free to just squash this code improvement into your next v2 patch.

Lukas

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

* Re: [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range()
  2022-08-22  9:05   ` Lukas Bulwahn
@ 2022-08-22  9:21     ` Miaohe Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaohe Lin @ 2022-08-22  9:21 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: kernel-janitors, Linux Kernel Mailing List, Mike Kravetz,
	Muchun Song, Andrew Morton, Linux-MM

On 2022/8/22 17:05, Lukas Bulwahn wrote:
> On Mon, Aug 22, 2022 at 10:51 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>>
>> On 2022/8/22 16:25, Lukas Bulwahn wrote:
>>> Commit a0e4f7b82610 ("mm/hugetlb: make detecting shared pte more reliable")
>>> modifies copy_hugetlb_page_range() such that huge_ptep_get(dst_pte) and the
>>> local variable dst_entry is not used explicitly in this function.
>>>
>>> Remove this unused local variable dst_entry in copy_hugetlb_page_range().
>>> No functional change.
>>>
>>> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
>>
>> LGTM. Thanks for your patch.
>>
>> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
>>
>> BTW: I will send a v2 of that series soon. So the above commit id might change.
>>
> 
> Feel free to just squash this code improvement into your next v2 patch.

Will do it. Thanks for your report and cleanup.

Thanks,
Miaohe Lin

> 
> Lukas
> .
> 


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

end of thread, other threads:[~2022-08-22  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  8:25 [PATCH] mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range() Lukas Bulwahn
2022-08-22  8:51 ` Miaohe Lin
2022-08-22  9:05   ` Lukas Bulwahn
2022-08-22  9:21     ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).