[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231129-slub-percpu-caches-v3-7-6bcf536772bc@suse.cz>
Date: Wed, 29 Nov 2023 10:53:32 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Matthew Wilcox <willy@...radead.org>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Hyeonggon Yoo <42.hyeyoo@...il.com>,
Alexander Potapenko <glider@...gle.com>,
Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, maple-tree@...ts.infradead.org,
kasan-dev@...glegroups.com
Subject: [PATCH RFC v3 7/9] maple_tree: use slub percpu array
Just make sure the maple_node_cache has a percpu array of size 32.
Will break with CONFIG_SLAB.
---
lib/maple_tree.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index bb24d84a4922..d9e7088fd9a7 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6213,9 +6213,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);
}
/**
--
2.43.0
Powered by blists - more mailing lists