From: Vlastimil Babka Date: Fri, 8 Sep 2023 07:57:13 +0000 (+0200) Subject: mm/slub: simplify the last resort slab order calculation X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c7355d755698a01ff4187a0d2f6ad21ba233dc21;p=linux.git mm/slub: simplify the last resort slab order calculation If calculate_order() can't fit even a single large object within slub_max_order, it will try using the smallest necessary order that may exceed slub_max_order but not MAX_ORDER. Currently this is done with a call to calc_slab_order() which is unnecessary. We can simply use get_order(size). No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Feng Tang Reviewed-and-tested-by: Jay Patel --- diff --git a/mm/slub.c b/mm/slub.c index b36e5eb0ccb72..0710adb5642ac 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4193,7 +4193,7 @@ static inline int calculate_order(unsigned int size) /* * Doh this slab cannot be placed using slub_max_order. */ - order = calc_slab_order(size, 1, MAX_ORDER, 1); + order = get_order(size); if (order <= MAX_ORDER) return order; return -ENOSYS;