[PATCH v3 42/66] kernel/events/core: Use maple tree iterators instead of linked list
From: Liam Howlett
Date: Mon Oct 04 2021 - 21:33:35 EST
From: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
kernel/events/core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0c000cb01eeb..fd72dd1c472c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10162,14 +10162,17 @@ static void perf_addr_filter_apply(struct perf_addr_filter *filter,
struct perf_addr_filter_range *fr)
{
struct vm_area_struct *vma;
+ MA_STATE(mas, &mm->mm_mt, 0, 0);
- for (vma = mm->mmap; vma; vma = vma->vm_next) {
+ rcu_read_lock();
+ mas_for_each(&mas, vma, ULONG_MAX) {
if (!vma->vm_file)
continue;
if (perf_addr_filter_vma_adjust(filter, vma, fr))
- return;
+ break;
}
+ rcu_read_unlock();
}
/*
--
2.30.2