[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260110040217.1927971-14-viro@zeniv.linux.org.uk>
Date: Sat, 10 Jan 2026 04:02:15 +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 13/15] turn fs_cachep static-duration
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
include/linux/fs_struct.h | 3 ++-
kernel/fork.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 0070764b790a..e8c9fac5b7b7 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -15,7 +15,8 @@ struct fs_struct {
struct path root, pwd;
} __randomize_layout;
-extern struct kmem_cache *fs_cachep;
+extern struct kmem_cache_opaque fs_struct_cache;
+#define fs_cachep to_kmem_cache(&fs_struct_cache)
extern void exit_fs(struct task_struct *);
extern void set_fs_root(struct fs_struct *, const struct path *);
diff --git a/kernel/fork.c b/kernel/fork.c
index 8f0dfefd82f0..7262abd0d2a4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -476,7 +476,7 @@ struct kmem_cache_opaque sighand_cache;
struct kmem_cache_opaque files_cache;
/* SLAB cache for fs_struct structures (tsk->fs) */
-struct kmem_cache *fs_cachep;
+struct kmem_cache_opaque fs_struct_cache;
/* SLAB cache for mm_struct structures (tsk->mm) */
static struct kmem_cache_opaque mm_cache;
@@ -3035,7 +3035,7 @@ void __init proc_caches_init(void)
sizeof(struct files_struct), 0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT,
NULL);
- fs_cachep = kmem_cache_create("fs_cache",
+ kmem_cache_setup(fs_cachep, "fs_cache",
sizeof(struct fs_struct), 0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT,
NULL);
--
2.47.3
Powered by blists - more mailing lists