aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
authorMark Brown <broonie@kernel.org>2026-05-29 14:59:13 +0100
committerMark Brown <broonie@kernel.org>2026-05-29 14:59:13 +0100
commitd692b8845cb3cfa4d005a5a360a26f692b09d178 (patch)
tree01330ed4686ce3e141e8bf069b7bc11bf770f6f2 /ipc
parent98e9aea604a182a40f8fb4b77ac426b3fdf00031 (diff)
parent4bd540bd9a0d7a2e8403a139e9f7631b06a57e89 (diff)
downloadlinux-next-history-d692b8845cb3cfa4d005a5a360a26f692b09d178.tar.gz
next-20260522/vfs-brauner
# Conflicts: # fs/fuse/dev.c
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msgutil.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index e28f0cecb2ec9..8aa8ac1803173 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -40,6 +40,7 @@ struct msg_msgseg {
#define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg))
static kmem_buckets *msg_buckets __ro_after_init;
+static kmem_buckets *msgseg_buckets __ro_after_init;
static int __init init_msg_buckets(void)
{
@@ -47,6 +48,10 @@ static int __init init_msg_buckets(void)
sizeof(struct msg_msg),
DATALEN_MSG, NULL);
+ msgseg_buckets = kmem_buckets_create("msg_msgseg", SLAB_ACCOUNT,
+ sizeof(struct msg_msgseg),
+ DATALEN_SEG, NULL);
+
return 0;
}
subsys_initcall(init_msg_buckets);
@@ -73,7 +78,8 @@ static struct msg_msg *alloc_msg(size_t len)
cond_resched();
alen = min(len, DATALEN_SEG);
- seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL_ACCOUNT);
+ seg = kmem_buckets_alloc(msgseg_buckets,
+ sizeof(*seg) + alen, GFP_KERNEL);
if (seg == NULL)
goto out_err;
*pseg = seg;