]> 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, 24 Jul 2020 17:32:30 +0000 (13:32 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 22 Oct 2021 00:27:27 +0000 (20:27 -0400)
commited0ef6fa16b906c48108664c70f44a5275f3be87
treebe284c54bccb57b36492ff55cf1170f988e9ffb1
parentdd86a0941adf37a91192b2cc535001c8df9cb594
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, rcu locking,
and switch to the maple tree advanced API to avoid multiple walks of the
tree during insert operations.

The maple tree header is now included and so use the maple tree
interface directly.  Drop the unused vma_store() function.

Note that the bulk allocation of nodes is also happening here for
performance reasons.  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>
include/linux/mm.h
include/linux/sched/mm.h
kernel/fork.c
mm/mmap.c