]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kernel/fork: use maple tree for dup_mmap() during forking
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 14 Apr 2022 06:07:14 +0000 (23:07 -0700)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 26 Apr 2022 14:36:31 +0000 (10:36 -0400)
commit3d799c1bcfc3d4c37b0d7e36e651c3954e5cd90d
tree9d32172866f73279b9b8039e9e20ac5ac698dbfc
parenta1f26eb382c1f93fa42a5c5abcc23ed93824cf53
kernel/fork: use maple tree for dup_mmap() during forking

The maple tree was already tracking VMAs in this function by an earlier
commit, but the rbtree iterator was being used to iterate the list.
Change the iterator to use a maple tree native iterator and switch to the
maple tree advanced API to avoid multiple walks of the tree during insert
operations.  Unexport the now-unused vma_store() function.

For performance reasons we bulk allocate the maple tree nodes.  The node
calculations are done internally to the tree and use the VMA count and
assume the worst-case node requirements.  The VM_DONT_COPY flag does not
allow for the most efficient copy method of the tree and so a bulk loading
algorithm is used.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
include/linux/mm.h
kernel/fork.c
mm/mmap.c