[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230810163627.6206-12-vbabka@suse.cz>
Date: Thu, 10 Aug 2023 18:36:31 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Matthew Wilcox <willy@...radead.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Christoph Lameter <cl@...ux.com>,
David Rientjes <rientjes@...gle.com>,
Pekka Enberg <penberg@...nel.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Hyeonggon Yoo <42.hyeyoo@...il.com>,
Roman Gushchin <roman.gushchin@...ux.dev>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
Vlastimil Babka <vbabka@...e.cz>
Subject: [RFC v2 3/7] 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 4dd73cf936a6..1196d0a17f03 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6180,9 +6180,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.41.0
Powered by blists - more mailing lists