mm/slub: remove forced_order parameter in calculate_sizes
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 9 Mar 2022 09:20:36 +0000 (17:20 +0800)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 9 Mar 2022 11:28:08 +0000 (12:28 +0100)
Since commit 32a6f409b693 ("mm, slub: remove runtime allocation order
changes"), forced_order is always -1. Remove this unneeded parameter
to simplify the code.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Link: https://lore.kernel.org/r/20220309092036.50844-1-linmiaohe@huawei.com
mm/slub.c

index d33aada17985815df4d45f552771867be910263f..498b56f66f5e1dd36c84f80fe028df7fd6fc616a 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4046,7 +4046,7 @@ static void set_cpu_partial(struct kmem_cache *s)
  * calculate_sizes() determines the order and the distribution of data within
  * a slab object.
  */
-static int calculate_sizes(struct kmem_cache *s, int forced_order)
+static int calculate_sizes(struct kmem_cache *s)
 {
        slab_flags_t flags = s->flags;
        unsigned int size = s->object_size;
@@ -4150,10 +4150,7 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
        size = ALIGN(size, s->align);
        s->size = size;
        s->reciprocal_size = reciprocal_value(size);
-       if (forced_order >= 0)
-               order = forced_order;
-       else
-               order = calculate_order(size);
+       order = calculate_order(size);
 
        if ((int)order < 0)
                return 0;
@@ -4189,7 +4186,7 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags)
        s->random = get_random_long();
 #endif
 
-       if (!calculate_sizes(s, -1))
+       if (!calculate_sizes(s))
                goto error;
        if (disable_higher_order_debug) {
                /*
@@ -4199,7 +4196,7 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags)
                if (get_order(s->size) > get_order(s->object_size)) {
                        s->flags &= ~DEBUG_METADATA_FLAGS;
                        s->offset = 0;
-                       if (!calculate_sizes(s, -1))
+                       if (!calculate_sizes(s))
                                goto error;
                }
        }