[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220318111709.60311-6-linmiaohe@huawei.com>
Date: Fri, 18 Mar 2022 19:17:03 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <ziy@...dia.com>, <baolin.wang@...ux.alibaba.com>,
<ying.huang@...el.com>, <songmuchun@...edance.com>,
<apopple@...dia.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <linmiaohe@...wei.com>
Subject: [PATCH v2 05/11] mm/migration: use helper function vma_lookup() in add_page_for_migration
We could use helper function vma_lookup() to lookup the needed vma to
simplify the code.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/migrate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index b16c561a9a4b..eb1c736750da 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1614,8 +1614,8 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr,
mmap_read_lock(mm);
err = -EFAULT;
- vma = find_vma(mm, addr);
- if (!vma || addr < vma->vm_start || !vma_migratable(vma))
+ vma = vma_lookup(mm, addr);
+ if (!vma || !vma_migratable(vma))
goto out;
/* FOLL_DUMP to ignore special (like zero) pages */
--
2.23.0
Powered by blists - more mailing lists