[PATCH 56/94] arch/powerpc: Remove mmap linked list from mm/book3s64/subpage_prot

From: Liam Howlett
Date: Wed Apr 28 2021 - 11:40:10 EST


Start using the maple tree

Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
arch/powerpc/mm/book3s64/subpage_prot.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/mm/book3s64/subpage_prot.c b/arch/powerpc/mm/book3s64/subpage_prot.c
index 60c6ea16a972..51722199408e 100644
--- a/arch/powerpc/mm/book3s64/subpage_prot.c
+++ b/arch/powerpc/mm/book3s64/subpage_prot.c
@@ -149,25 +149,18 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr,
unsigned long len)
{
struct vm_area_struct *vma;
+ MA_STATE(mas, &mm->mm_mt, addr, addr);

/*
* We don't try too hard, we just mark all the vma in that range
* VM_NOHUGEPAGE and split them.
*/
- vma = find_vma(mm, addr);
- /*
- * If the range is in unmapped range, just return
- */
- if (vma && ((addr + len) <= vma->vm_start))
- return;
-
- while (vma) {
- if (vma->vm_start >= (addr + len))
- break;
+ rcu_read_lock();
+ mas_for_each(&mas, vma, addr + len) {
vma->vm_flags |= VM_NOHUGEPAGE;
walk_page_vma(vma, &subpage_walk_ops, NULL);
- vma = vma->vm_next;
}
+ rcu_read_unlock();
}
#else
static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr,
--
2.30.2