]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: use slub percpu array
authorVlastimil Babka <vbabka@suse.cz>
Mon, 7 Aug 2023 18:52:02 +0000 (20:52 +0200)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 29 Apr 2024 14:50:35 +0000 (10:50 -0400)
Just make sure the maple_node_cache has a percpu array of size 32.

Will break with CONFIG_SLAB.

lib/maple_tree.c

index 1449608b337fdf7d8c50014e980f494bc174aed5..b9b55a73e37da56f1918f3f70327df390a7c5da4 100644 (file)
@@ -6316,9 +6316,16 @@ bool mas_nomem(struct ma_state *mas, gfp_t gfp)
 
 void __init maple_tree_init(void)
 {
+       int ret;
+
        maple_node_cache = kmem_cache_create("maple_node",
                        sizeof(struct maple_node), sizeof(struct maple_node),
-                       SLAB_PANIC, NULL);
+                       SLAB_PANIC | SLAB_NO_MERGE, NULL);
+
+       ret = kmem_cache_setup_percpu_array(maple_node_cache, 32);
+
+       if (ret)
+               pr_warn("error %d creating percpu_array for maple_node_cache\n", ret);
 }
 
 /**