mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
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>
This commit is contained in:
parent
e519ce7a26
commit
c7355d7556
1 changed files with 1 additions and 1 deletions
|
@ -4193,7 +4193,7 @@ static inline int calculate_order(unsigned int size)
|
||||||
/*
|
/*
|
||||||
* Doh this slab cannot be placed using slub_max_order.
|
* 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)
|
if (order <= MAX_ORDER)
|
||||||
return order;
|
return order;
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
Loading…
Reference in a new issue