]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: remove GFP_ZERO from kmem_cache_alloc() and kmem_cache_alloc_bulk()
authorLiam Howlett <liam.howlett@oracle.com>
Thu, 5 Jan 2023 16:05:34 +0000 (16:05 +0000)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 22 Mar 2023 16:01:40 +0000 (12:01 -0400)
commitaef352e84c87046bc13a7f0634669eed614183b3
tree3c654a2de19acbd64af596341c4a6bb3c9d7de6d
parent7eaef76fbc4621ced374c85dbc000dd80dc681d7
maple_tree: remove GFP_ZERO from kmem_cache_alloc() and kmem_cache_alloc_bulk()

Preallocations are common in the VMA code to avoid allocating under
certain locking conditions.  The preallocations must also cover the
worst-case scenario.  Removing the GFP_ZERO flag from the
kmem_cache_alloc() (and bulk variant) calls will reduce the amount of time
spent zeroing memory that may not be used.  Only zero out the necessary
area to keep track of the allocations in the maple state.  Zero the entire
node prior to using it in the tree.

This required internal changes to node counting on allocation, so the test
code is also updated.

This restores some micro-benchmark performance: up to +9% in mmtests mmap1
by my testing +10% to +20% in mmap, mmapaddr, mmapmany tests reported by
Red Hat

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2149636
Link: https://lkml.kernel.org/r/20230105160427.2988454-1-Liam.Howlett@oracle.com
Cc: stable@vger.kernel.org
Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Signed-off-by: Liam Howlett <Liam.Howlett@oracle.com>
Reported-by: Jirka Hladky <jhladky@redhat.com>
Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
lib/maple_tree.c
tools/testing/radix-tree/maple.c