mm/slub: fix MAX_ORDER usage in calculate_order()
MAX_ORDER is not inclusive: the maximum allocation order buddy allocator can deliver is MAX_ORDER-1. Fix MAX_ORDER usage in calculate_order(). Link: https://lkml.kernel.org/r/20230315113133.11326-9-kirill.shutemov@linux.intel.com Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
668a89907c
commit
7a16d7c761
@ -4171,7 +4171,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 = calc_slab_order(size, 1, MAX_ORDER - 1, 1);
|
||||
if (order < MAX_ORDER)
|
||||
return order;
|
||||
return -ENOSYS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user