summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mm/slub.c b/mm/slub.c
index c4b5f48149e8..86141e5164ca 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4171,9 +4171,11 @@ static inline int calculate_order(unsigned int size)
* the order can only result in same or less fractional waste, not more.
*
* If that fails, we increase the acceptable fraction of waste and try
- * again.
+ * again. The last iteration with fraction of 1/2 would effectively
+ * accept any waste and give us the order determined by min_objects, as
+ * long as at least single object fits within slub_max_order.
*/
- for (unsigned int fraction = 16; fraction >= 4; fraction /= 2) {
+ for (unsigned int fraction = 16; fraction > 1; fraction /= 2) {
order = calc_slab_order(size, min_objects, slub_max_order,
fraction);
if (order <= slub_max_order)
@@ -4181,14 +4183,6 @@ static inline int calculate_order(unsigned int size)
}
/*
- * We were unable to place multiple objects in a slab. Now
- * lets see if we can place a single object there.
- */
- order = calc_slab_order(size, 1, slub_max_order, 1);
- if (order <= slub_max_order)
- return order;
-
- /*
* Doh this slab cannot be placed using slub_max_order.
*/
order = get_order(size);