]> 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>
Fri, 22 Oct 2021 17:53:01 +0000 (13:53 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 14 Mar 2022 18:49:44 +0000 (14:49 -0400)
commit60073e0ed220f2392736f6f340807748da2bc8c3
treef12a13c1bf8b977786aaea133a376f3c35d8486a
parent12b8fb7d11e49f83c1003f86a0f2273c55b59f29
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: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
include/linux/mm.h
kernel/fork.c
mm/mmap.c