diff mbox series

mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range()

Message ID 20220822082525.26071-1-lukas.bulwahn@gmail.com (mailing list archive)
State New
Headers show
Series mm/hugetlb: remove unused local variable dst_entry in copy_hugetlb_page_range() | expand

Commit Message

Lukas Bulwahn Aug. 22, 2022, 8:25 a.m. UTC
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(-)

Comments

Miaohe Lin Aug. 22, 2022, 8:51 a.m. UTC | #1
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
Lukas Bulwahn Aug. 22, 2022, 9:05 a.m. UTC | #2
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
Miaohe Lin Aug. 22, 2022, 9:21 a.m. UTC | #3
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
> .
>
diff mbox series

Patch

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);