aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam R. Howlett <[email protected]>2022-09-06 19:49:05 +0000
committerAndrew Morton <[email protected]>2022-09-26 19:46:26 -0700
commit78ba531ff3ec2a444001853d8636ff39ed11ca28 (patch)
treec7a94a11dd434707be6686a3247758b0e20043bf
parent9b580a1d60de0e1c8957e63859aa989196952e63 (diff)
mm/vmscan: use vma iterator instead of vm_next
Use the vma iterator in in get_next_vma() instead of the linked list. [[email protected]: mm/vmscan: use the proper VMA iterator] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liam R. Howlett <[email protected]> Signed-off-by: Yu Zhao <[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: Vlastimil Babka <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/vmscan.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 809df16c7c0d..3ba9423b141d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3774,23 +3774,17 @@ 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;
- continue;
- }
-
+ for_each_vma(vmi, args->vma) {
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;
+ if (should_skip_vma(args->vma->vm_start, args->vma->vm_end, args))
continue;
- }
*vm_start = max(start, args->vma->vm_start);
*vm_end = min(end - 1, args->vma->vm_end - 1) + 1;