[37/94] mm/khugepaged: Optimize collapse_pte_mapped_thp() by using vma_lookup()
diff mbox series

Message ID 20210428153542.2814175-38-Liam.Howlett@Oracle.com
State New, archived
Headers show
Series
  • Introducing the Maple Tree
Related show

Commit Message

Liam Howlett April 28, 2021, 3:36 p.m. UTC
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.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 6c0185fdd815..33cf91529f0b 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1431,7 +1431,7 @@  static int khugepaged_add_pte_mapped_thp(struct mm_struct *mm,
 void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr)
 {
 	unsigned long haddr = addr & HPAGE_PMD_MASK;
-	struct vm_area_struct *vma = find_vma(mm, haddr);
+	struct vm_area_struct *vma = vma_lookup(mm, haddr);
 	struct page *hpage;
 	pte_t *start_pte, *pte;
 	pmd_t *pmd, _pmd;