Skip to content

Commit 94d815b

Browse files
howlettakpm00
authored andcommitted
mm/khugepaged: optimize collapse_pte_mapped_thp() by using vma_lookup()
vma_lookup() will walk the vma tree once and not continue to look for the next vma. Since the exact vma is checked below, this is a more optimal way of searching. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liam R. Howlett <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Tested-by: Yu Zhao <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David Howells <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: "Matthew Wilcox (Oracle)" <[email protected]> Cc: SeongJae Park <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent dc8635b commit 94d815b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/khugepaged.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ static void collapse_and_free_pmd(struct mm_struct *mm, struct vm_area_struct *v
13891389
void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
13901390
{
13911391
unsigned long haddr = addr & HPAGE_PMD_MASK;
1392-
struct vm_area_struct *vma = find_vma(mm, haddr);
1392+
struct vm_area_struct *vma = vma_lookup(mm, haddr);
13931393
struct page *hpage;
13941394
pte_t *start_pte, *pte;
13951395
pmd_t *pmd;

0 commit comments

Comments
 (0)