Skip to contentSkip to conversation

mm/slab: remove unused slab_early_init

PATCH Superseded [email protected] 2 participants 3 messages Dec 17, 2022 – Dec 18, 2022 Memory management

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab: remove unused slab_early_init

From: Gou Hao <[email protected]>

'slab_early_init' was introduced by 'commit e0a42726794f ("[PATCH] mm/slab.c: fix early init assumption")', this flag was used to prevented off-slab caches being created so early during bootup.

The only user of 'slab_early_init' was removed in commit '3217fd9bdf00 ("mm/slab: make criteria for off slab determination robust and simple")'.

---
 mm/slab.c | 3 ---
 1 file changed, 3 deletions(-)
mm/slab.c +0 -3
index 7a269db050ee..ede1f29fd81c 100644
@@ -220,7 +220,6 @@ static inline void fixup_objfreelist_debug(struct kmem_cache *cachep,
 static inline void fixup_slab_list(struct kmem_cache *cachep,
 				struct kmem_cache_node *n, struct slab *slab,
 				void **list);
-static int slab_early_init = 1;
 
 #define INDEX_NODE kmalloc_index(sizeof(struct kmem_cache_node))
 
@@ -1249,8 +1248,6 @@ void __init kmem_cache_init(void)
 	slab_state = PARTIAL_NODE;
 	setup_kmalloc_cache_index_table();
 
-	slab_early_init = 0;
-
 	/* 5) Replace the bootstrap kmem_cache_node */
 	{
 		int nid;
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Sat, Dec 17, 2022 at 07:30:45PM +0800, [email protected] wrote:

From: Gou Hao <[email protected]>

'slab_early_init' was introduced by 'commit e0a42726794f ("[PATCH] mm/slab.c: fix early init assumption")', this flag was used to prevented off-slab caches being created

s/prevented/prevent

Quoted 34 lines

so early during bootup.

The only user of 'slab_early_init' was removed in commit '3217fd9bdf00 ("mm/slab: make criteria for off slab determination robust and simple")'.

---
 mm/slab.c | 3 ---
 1 file changed, 3 deletions(-)
mm/slab.c +0 -3
index 7a269db050ee..ede1f29fd81c 100644
@@ -220,7 +220,6 @@ static inline void fixup_objfreelist_debug(struct kmem_cache *cachep,
 static inline void fixup_slab_list(struct kmem_cache *cachep,
 				struct kmem_cache_node *n, struct slab *slab,
 				void **list);
-static int slab_early_init = 1;
 
 #define INDEX_NODE kmalloc_index(sizeof(struct kmem_cache_node))
 
@@ -1249,8 +1248,6 @@ void __init kmem_cache_init(void)
 	slab_state = PARTIAL_NODE;
 	setup_kmalloc_cache_index_table();
 
-	slab_early_init = 0;
-
 	/* 5) Replace the bootstrap kmem_cache_node */
 	{
 		int nid;
Signature · 1 line
2.20.1

Nice cleanup, thanks!

Signature · 2 lines
Thanks,
Hyeonggon
#2 lore raw

Thanks for your review, i will fix it in next version patch. :)

Thanks,
Gou Hao

Quoted 39 lines
Quoted 35 lines

so early during bootup.

The only user of 'slab_early_init' was removed in commit '3217fd9bdf00 ("mm/slab: make criteria for off slab determination robust and simple")'.

---
 mm/slab.c | 3 ---
 1 file changed, 3 deletions(-)
mm/slab.c +0 -3
index 7a269db050ee..ede1f29fd81c 100644
@@ -220,7 +220,6 @@ static inline void fixup_objfreelist_debug(struct kmem_cache *cachep,
 static inline void fixup_slab_list(struct kmem_cache *cachep,
 				struct kmem_cache_node *n, struct slab *slab,
 				void **list);
-static int slab_early_init = 1;
 
 #define INDEX_NODE kmalloc_index(sizeof(struct kmem_cache_node))
 
@@ -1249,8 +1248,6 @@ void __init kmem_cache_init(void)
 	slab_state = PARTIAL_NODE;
 	setup_kmalloc_cache_index_table();
 
-	slab_early_init = 0;
-
 	/* 5) Replace the bootstrap kmem_cache_node */
 	{
 		int nid;
Signature · 1 line
2.20.1

Nice cleanup, thanks!