diff options
author | Vlastimil Babka <vbabka@suse.cz> | 2025-09-03 14:59:55 +0200 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2025-09-29 09:22:57 +0200 |
commit | 59faa4da7cd4565cbce25358495556b75bb37022 (patch) | |
tree | 544867a8cda48d5bf58f8656502363ab86e955e3 | |
parent | 3accabda4da1b00ba21dc18573a0a43e032e35f4 (diff) |
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 <sidhartha.kumar@oracle.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
-rw-r--r-- | lib/maple_tree.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 4f0e30b57b0c..d034f170ac89 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -6040,9 +6040,14 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp) void __init maple_tree_init(void) { + struct kmem_cache_args args = { + .align = sizeof(struct maple_node), + .sheaf_capacity = 32, + }; + maple_node_cache = kmem_cache_create("maple_node", - sizeof(struct maple_node), sizeof(struct maple_node), - SLAB_PANIC, NULL); + sizeof(struct maple_node), &args, + SLAB_PANIC); } /** |