lkml.org 
[lkml]   [2023]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 35/35] mm: Avoid rewalk in mmap_region
Date
If the iterator has moved to the previous entry, then step forward one
range, back to the gap.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
mm/mmap.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/mm/mmap.c b/mm/mmap.c
index 1602c854133a..71733953ff83 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2636,6 +2636,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
}

cannot_expand:
+ if (prev)
+ vma_iter_next_range(&vmi);
+
/*
* Determine the object being mapped and call the appropriate
* specific mapper. the address has already been validated, but
--
2.39.2
\
 
 \ /
  Last update: 2023-05-18 21:00    [W:0.208 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site