Skip to content

Commit

Permalink
mm/huge_memory: use helper function vma_lookup in split_huge_pages_pid
Browse files Browse the repository at this point in the history
Use helper function vma_lookup to lookup the needed vma to simplify the
code. Minor readability improvement.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Zach O'Keefe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
MiaoheLin authored and akpm00 committed Jul 18, 2022
1 parent 4fba8f2 commit 74ba2b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 74ba2b3

Please sign in to comment.