diff mbox series

[v2,15/70] mm/mmap: Change vm_brk_flags() to use mm_populate_vma()

Message ID 20210112161240.2024684-16-Liam.Howlett@Oracle.com (mailing list archive)
State New, archived
Headers show
Series RFC mm: Introducing the Maple Tree | expand

Commit Message

Liam R. Howlett Jan. 12, 2021, 4:11 p.m. UTC
Skip searching for the vma to populate after creating it by passing in a pointer.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 mm/mmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mm/mmap.c b/mm/mmap.c
index f500d5e490f1c..cab665a6daa05 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3045,10 +3045,10 @@  int vm_brk_flags(unsigned long addr, unsigned long request, unsigned long flags)
 	// This vma left intentionally blank.
 	mas_walk(&mas);
 	ret = do_brk_flags(&mas, &vma, addr, len, flags);
-	populate = ((mm->def_flags & VM_LOCKED) != 0);
 	mmap_write_unlock(mm);
+	populate = ((mm->def_flags & VM_LOCKED) != 0);
 	if (populate && !ret)
-		mm_populate(addr, len);
+		mm_populate_vma(vma, addr, addr + len);
 	return ret;
 }
 EXPORT_SYMBOL(vm_brk_flags);