[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210112161240.2024684-55-Liam.Howlett@Oracle.com>
Date: Tue, 12 Jan 2021 11:12:24 -0500
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...gle.com>, Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E . McKenney" <paulmck@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Jerome Glisse <jglisse@...hat.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rik van Riel <riel@...riel.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: [PATCH v2 54/70] mm/khugepaged: Use maple tree iterators instead of vma linked list
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
mm/khugepaged.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 4e3dff13eb70c..fbfcee552da6c 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -2049,6 +2049,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
struct mm_struct *mm;
struct vm_area_struct *vma;
int progress = 0;
+ MA_STATE(mas, NULL, 0, 0);
VM_BUG_ON(!pages);
lockdep_assert_held(&khugepaged_mm_lock);
@@ -2065,18 +2066,20 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
khugepaged_collapse_pte_mapped_thps(mm_slot);
mm = mm_slot->mm;
+ mas.tree = &mm->mm_mt;
/*
* Don't wait for semaphore (to avoid long wait times). Just move to
* the next mm on the list.
*/
vma = NULL;
+ mas_set(&mas, khugepaged_scan.address);
if (unlikely(!mmap_read_trylock(mm)))
goto breakouterloop_mmap_lock;
if (likely(!khugepaged_test_exit(mm)))
- vma = find_vma(mm, khugepaged_scan.address);
+ vma = mas_find(&mas, ULONG_MAX);
progress++;
- for (; vma; vma = vma->vm_next) {
+ mas_for_each(&mas, vma, ULONG_MAX) {
unsigned long hstart, hend;
cond_resched();
--
2.28.0
Powered by blists - more mailing lists