summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorWei Yang <weiyang@linux.vnet.ibm.com>2015-11-05 18:45:48 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 19:34:48 -0800
commit033fd1bd3c50fdda267d27d02f9bc656f0b9ddb8 (patch)
tree74b742a65bc35c7a5aba4189c988f6ca621f1d4e /mm/slub.c
parent422ff4d70c1b3b2deed431dc095432dc691f4269 (diff)
downloadlinux-stable-033fd1bd3c50fdda267d27d02f9bc656f0b9ddb8.tar.gz
linux-stable-033fd1bd3c50fdda267d27d02f9bc656f0b9ddb8.tar.bz2
linux-stable-033fd1bd3c50fdda267d27d02f9bc656f0b9ddb8.zip
mm/slub: use get_order() instead of fls()
get_order() is more easy to understand. This patch just replaces it. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index a94b9f46261b..e309ed140fd1 100644
--- 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;