Skip to content

Commit c7355d7

Browse files
committed
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 <vbabka@suse.cz> Reviewed-by: Feng Tang <feng.tang@intel.com> Reviewed-and-tested-by: Jay Patel <jaypatel@linux.ibm.com>
1 parent e519ce7 commit c7355d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4193,7 +4193,7 @@ static inline int calculate_order(unsigned int size)
41934193
/*
41944194
* Doh this slab cannot be placed using slub_max_order.
41954195
*/
4196-
order = calc_slab_order(size, 1, MAX_ORDER, 1);
4196+
order = get_order(size);
41974197
if (order <= MAX_ORDER)
41984198
return order;
41994199
return -ENOSYS;

0 commit comments

Comments
 (0)