Skip to content

Commit 59faa4d

Browse files
committed
maple_tree: use percpu sheaves for maple_node_cache
Setup the maple_node_cache with percpu sheaves of size 32 to hopefully improve its performance. Note this will not immediately take advantage of sheaf batching of kfree_rcu() operations due to the maple tree using call_rcu with custom callbacks. The followup changes to maple tree will change that and also make use of the prefilled sheaves functionality. Reviewed-by: Sidhartha Kumar <[email protected]> Reviewed-by: Suren Baghdasaryan <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 3accabd commit 59faa4d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/maple_tree.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6040,9 +6040,14 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp)
60406040

60416041
void __init maple_tree_init(void)
60426042
{
6043+
struct kmem_cache_args args = {
6044+
.align = sizeof(struct maple_node),
6045+
.sheaf_capacity = 32,
6046+
};
6047+
60436048
maple_node_cache = kmem_cache_create("maple_node",
6044-
sizeof(struct maple_node), sizeof(struct maple_node),
6045-
SLAB_PANIC, NULL);
6049+
sizeof(struct maple_node), &args,
6050+
SLAB_PANIC);
60466051
}
60476052

60486053
/**

0 commit comments

Comments
 (0)