mm/huge_memory: use helper function vma_lookup in split_huge_pages_pid
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 4 Jul 2022 13:21:52 +0000 (21:21 +0800)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:45 +0000 (17:14 -0700)
Use helper function vma_lookup to lookup the needed vma to simplify the
code. Minor readability improvement.

Link: https://lkml.kernel.org/r/20220704132201.14611-8-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index 5816ef8..a8f8af8 100644 (file)
@@ -2941,10 +2941,10 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start,
         * table filled with PTE-mapped THPs, each of which is distinct.
         */
        for (addr = vaddr_start; addr < vaddr_end; addr += PAGE_SIZE) {
-               struct vm_area_struct *vma = find_vma(mm, addr);
+               struct vm_area_struct *vma = vma_lookup(mm, addr);
                struct page *page;
 
-               if (!vma || addr < vma->vm_start)
+               if (!vma)
                        break;
 
                /* skip special VMA and hugetlb VMA */