Commit 74ba2b38 authored by Miaohe Lin's avatar Miaohe Lin Committed by akpm

mm/huge_memory: use helper function vma_lookup in split_huge_pages_pid

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.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarMuchun 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 4fba8f2a
...@@ -2941,10 +2941,10 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, ...@@ -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. * table filled with PTE-mapped THPs, each of which is distinct.
*/ */
for (addr = vaddr_start; addr < vaddr_end; addr += PAGE_SIZE) { 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; struct page *page;
if (!vma || addr < vma->vm_start) if (!vma)
break; break;
/* skip special VMA and hugetlb VMA */ /* skip special VMA and hugetlb VMA */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment