[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260110040217.1927971-13-viro@zeniv.linux.org.uk>
Date: Sat, 10 Jan 2026 04:02:14 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: linux-mm@...ck.org
Cc: Vlastimil Babka <vbabka@...e.cz>,
Harry Yoo <harry.yoo@...cle.com>,
linux-fsdevel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>,
Mateusz Guzik <mguzik@...il.com>,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 12/15] turn task_struct_cachep static-duration
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
kernel/fork.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index f83ca2f5826f..8f0dfefd82f0 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -178,7 +178,8 @@ void __weak arch_release_task_struct(struct task_struct *tsk)
{
}
-static struct kmem_cache *task_struct_cachep;
+static struct kmem_cache_opaque task_struct_cache;
+#define task_struct_cachep to_kmem_cache(&task_struct_cache)
static inline struct task_struct *alloc_task_struct_node(int node)
{
@@ -860,7 +861,7 @@ void __init fork_init(void)
/* create a slab on which task_structs can be allocated */
task_struct_whitelist(&useroffset, &usersize);
- task_struct_cachep = kmem_cache_create_usercopy("task_struct",
+ kmem_cache_setup_usercopy(task_struct_cachep, "task_struct",
arch_task_struct_size, align,
SLAB_PANIC|SLAB_ACCOUNT,
useroffset, usersize, NULL);
--
2.47.3
Powered by blists - more mailing lists