[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220822150128.1562046-68-Liam.Howlett@oracle.com>
Date: Mon, 22 Aug 2022 15:06:33 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
CC: Liam Howlett <liam.howlett@...cle.com>, Yu Zhao <yuzhao@...gle.com>
Subject: [PATCH v13 67/70] mm/vmscan: Use vma iterator instead of vm_next
Use the vma iterator in in get_next_vma() instead of the linked list.
Suggested-by: Yu Zhao <yuzhao@...gle.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
mm/vmscan.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index f693720047db..9b292f07621e 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3747,23 +3747,14 @@ static bool get_next_vma(unsigned long mask, unsigned long size, struct mm_walk
{
unsigned long start = round_up(*vm_end, size);
unsigned long end = (start | ~mask) + 1;
+ VMA_ITERATOR(vmi, args->mm, start);
VM_WARN_ON_ONCE(mask & size);
VM_WARN_ON_ONCE((start & mask) != (*vm_start & mask));
- while (args->vma) {
- if (start >= args->vma->vm_end) {
- args->vma = args->vma->vm_next;
+ for_each_vma_range(vmi, args->vma, end) {
+ if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args))
continue;
- }
-
- if (end && end <= args->vma->vm_start)
- return false;
-
- if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args)) {
- args->vma = args->vma->vm_next;
- continue;
- }
*vm_start = max(start, args->vma->vm_start);
*vm_end = min(end - 1, args->vma->vm_end - 1) + 1;
--
2.35.1
Powered by blists - more mailing lists