mm/slub: use get_order() instead of fls()
authorWei Yang <[email protected]>
Fri, 6 Nov 2015 02:45:48 +0000 (18:45 -0800)
committerLinus Torvalds <[email protected]>
Fri, 6 Nov 2015 03:34:48 +0000 (19:34 -0800)
get_order() is more easy to understand.

This patch just replaces it.

Signed-off-by: Wei Yang <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Reviewed-by: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/slub.c

index a94b9f46261b020a5f0aeee1d82a3aee1b4eb785..e309ed140fd18c067edacae0c7b7150cc20c6df6 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2912,8 +2912,7 @@ static inline int slab_order(int size, int min_objects,
        if (order_objects(min_order, size, reserved) > MAX_OBJS_PER_PAGE)
                return get_order(size * MAX_OBJS_PER_PAGE) - 1;
 
-       for (order = max(min_order,
-                               fls(min_objects * size - 1) - PAGE_SHIFT);
+       for (order = max(min_order, get_order(min_objects * size));
                        order <= max_order; order++) {
 
                unsigned long slab_size = PAGE_SIZE << order;