mm/vmscan: use vma iterator instead of vm_next
Use the vma iterator in in get_next_vma() instead of the linked list. [yuzhao@google.com: mm/vmscan: use the proper VMA iterator] Link: https://lkml.kernel.org/r/Yx+QGOgHg1Wk8tGK@google.com Link: https://lkml.kernel.org/r/20220906194824.2110408-68-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Signed-off-by: Yu Zhao <yuzhao@google.com> Tested-by: Yu Zhao <yuzhao@google.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Hildenbrand <david@redhat.com> Cc: David Howells <dhowells@redhat.com> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org> Cc: SeongJae Park <sj@kernel.org> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
9b580a1d60
commit
78ba531ff3
12
mm/vmscan.c
12
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user