Skip to contentSkip to conversation

mm/slub: remove unused kmem_cache_order_objects max

PATCH In review Miaohe Lin 4 participants 4 messages Apr 29, 2022 – May 2, 2022

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 mm/slub: remove unused kmem_cache_order_objects max

max field holds the largest slab order that was ever used for a slab cache. But it's unused now. Remove it.

---
 include/linux/slub_def.h | 1 -
 mm/slub.c                | 2 --
 2 files changed, 3 deletions(-)
include/linux/slub_def.h +0 -1
index 33c5c0e3bd8d..f9c68a9dac04 100644
@@ -105,7 +105,6 @@ struct kmem_cache {
 	struct kmem_cache_order_objects oo;
 
 	/* Allocation and freeing of slabs */
-	struct kmem_cache_order_objects max;
 	struct kmem_cache_order_objects min;
 	gfp_t allocflags;	/* gfp flags to use on each alloc */
 	int refcount;		/* Refcount for slab cache destroy */
mm/slub.c +0 -2
index 1f699ddfff7f..e5535020e0fd 100644
@@ -4162,8 +4162,6 @@ static int calculate_sizes(struct kmem_cache *s)
 	 */
 	s->oo = oo_make(order, size);
 	s->min = oo_make(get_order(size), size);
-	if (oo_objects(s->oo) > oo_objects(s->max))
-		s->max = s->oo;
 
 	return !!oo_objects(s->oo);
 }
Signature · 1 line
2.23.0
#1 lore raw
Quoted 4 lines · Miaohe Lin

max field holds the largest slab order that was ever used for a slab cache. But it's unused now. Remove it.

Added to slab tree, thanks.

Quoted 30 lines
---
 include/linux/slub_def.h | 1 -
 mm/slub.c                | 2 --
 2 files changed, 3 deletions(-)
include/linux/slub_def.h +0 -1
index 33c5c0e3bd8d..f9c68a9dac04 100644
@@ -105,7 +105,6 @@ struct kmem_cache {
 	struct kmem_cache_order_objects oo;
 
 	/* Allocation and freeing of slabs */
-	struct kmem_cache_order_objects max;
 	struct kmem_cache_order_objects min;
 	gfp_t allocflags;	/* gfp flags to use on each alloc */
 	int refcount;		/* Refcount for slab cache destroy */
mm/slub.c +0 -2
index 1f699ddfff7f..e5535020e0fd 100644
@@ -4162,8 +4162,6 @@ static int calculate_sizes(struct kmem_cache *s)
 	 */
 	s->oo = oo_make(order, size);
 	s->min = oo_make(get_order(size), size);
-	if (oo_objects(s->oo) > oo_objects(s->max))
-		s->max = s->oo;
 
 	return !!oo_objects(s->oo);
 }