summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2024-07-15 10:44:16 +0200
committerVlastimil Babka <vbabka@suse.cz>2024-07-15 10:44:16 +0200
commit436381eaf2a423e60fc8340399f7d2458091b383 (patch)
tree16ecce9d2dcb5ed43de60a966e9026c9ffd6e711 /ipc
parenta52c6330ff2fe1163333fa6609bdc6e8763ec286 (diff)
parentd73778e4b86755d527a0c6b249cde846770b2f66 (diff)
Merge branch 'slab/for-6.11/buckets' into slab/for-next
Merge all the slab patches previously collected on top of v6.10-rc1, over cleanups/fixes that had to be based on rc6.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msgutil.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index d0a0e877cadd..c7be0c792647 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -42,6 +42,17 @@ struct msg_msgseg {
#define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg))
#define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg))
+static kmem_buckets *msg_buckets __ro_after_init;
+
+static int __init init_msg_buckets(void)
+{
+ msg_buckets = kmem_buckets_create("msg_msg", SLAB_ACCOUNT,
+ sizeof(struct msg_msg),
+ DATALEN_MSG, NULL);
+
+ return 0;
+}
+subsys_initcall(init_msg_buckets);
static struct msg_msg *alloc_msg(size_t len)
{
@@ -50,7 +61,7 @@ static struct msg_msg *alloc_msg(size_t len)
size_t alen;
alen = min(len, DATALEN_MSG);
- msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL_ACCOUNT);
+ msg = kmem_buckets_alloc(msg_buckets, sizeof(*msg) + alen, GFP_KERNEL);
if (msg == NULL)
return NULL;