diff mbox series

[06/16] mm/huge_memory: rename mmun_start to haddr in remove_migration_pmd

Message ID 20220622170627.19786-7-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for huge_memory | expand

Commit Message

Miaohe Lin June 22, 2022, 5:06 p.m. UTC
mmun_start indicates mmu_notifier start address but there's no mmu_notifier
stuff in remove_migration_pmd. This will make it hard to get the meaning of
mmun_start. Rename it to haddr to avoid confusing readers and also imporve
readability.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/huge_memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Muchun Song June 23, 2022, 6:46 a.m. UTC | #1
On Thu, Jun 23, 2022 at 01:06:17AM +0800, Miaohe Lin wrote:
> mmun_start indicates mmu_notifier start address but there's no mmu_notifier

Actually I don't know what "mmun" prefix means. But this change looks good to
me.

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

> stuff in remove_migration_pmd. This will make it hard to get the meaning of
> mmun_start. Rename it to haddr to avoid confusing readers and also imporve
> readability.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/huge_memory.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index c6302fe6704b..fb5c484dfa39 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -3181,7 +3181,7 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
>  	struct vm_area_struct *vma = pvmw->vma;
>  	struct mm_struct *mm = vma->vm_mm;
>  	unsigned long address = pvmw->address;
> -	unsigned long mmun_start = address & HPAGE_PMD_MASK;
> +	unsigned long haddr = address & HPAGE_PMD_MASK;
>  	pmd_t pmde;
>  	swp_entry_t entry;
>  
> @@ -3204,12 +3204,12 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
>  		if (!is_readable_migration_entry(entry))
>  			rmap_flags |= RMAP_EXCLUSIVE;
>  
> -		page_add_anon_rmap(new, vma, mmun_start, rmap_flags);
> +		page_add_anon_rmap(new, vma, haddr, rmap_flags);
>  	} else {
>  		page_add_file_rmap(new, vma, true);
>  	}
>  	VM_BUG_ON(pmd_write(pmde) && PageAnon(new) && !PageAnonExclusive(new));
> -	set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
> +	set_pmd_at(mm, haddr, pvmw->pmd, pmde);
>  
>  	/* No need to invalidate - it was non-present before */
>  	update_mmu_cache_pmd(vma, address, pvmw->pmd);
> -- 
> 2.23.0
> 
>
diff mbox series

Patch

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c6302fe6704b..fb5c484dfa39 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3181,7 +3181,7 @@  void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
 	struct vm_area_struct *vma = pvmw->vma;
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long address = pvmw->address;
-	unsigned long mmun_start = address & HPAGE_PMD_MASK;
+	unsigned long haddr = address & HPAGE_PMD_MASK;
 	pmd_t pmde;
 	swp_entry_t entry;
 
@@ -3204,12 +3204,12 @@  void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
 		if (!is_readable_migration_entry(entry))
 			rmap_flags |= RMAP_EXCLUSIVE;
 
-		page_add_anon_rmap(new, vma, mmun_start, rmap_flags);
+		page_add_anon_rmap(new, vma, haddr, rmap_flags);
 	} else {
 		page_add_file_rmap(new, vma, true);
 	}
 	VM_BUG_ON(pmd_write(pmde) && PageAnon(new) && !PageAnonExclusive(new));
-	set_pmd_at(mm, mmun_start, pvmw->pmd, pmde);
+	set_pmd_at(mm, haddr, pvmw->pmd, pmde);
 
 	/* No need to invalidate - it was non-present before */
 	update_mmu_cache_pmd(vma, address, pvmw->pmd);