[PATCH 1/3] mm/slub: remove always-true check in calculate_sizes()

From: Sang-Heon Jeon

Date: Tue Dec 01 2026 - 11:53:20 EST


When calculate_order() succeeds, a slab of the returned order holds at
least one and at most MAX_OBJS_PER_PAGE objects, so oo_objects(s->oo)
is never zero.

So remove the check and return 1 explicitly.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 47a664427c50..e966a0de1515 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -8233,7 +8233,7 @@ static int calculate_sizes(struct kmem_cache_args *args, struct kmem_cache *s)
s->oo = oo_make(order, size);
s->min = oo_make(get_order(size), size);

- return !!oo_objects(s->oo);
+ return 1;
}

static void list_slab_objects(struct kmem_cache *s, struct slab *slab)
--
2.53.0