提交 033fd1bd 编写于 作者: W Wei Yang 提交者: Linus Torvalds

mm/slub: use get_order() instead of fls()

get_order() is more easy to understand.

This patch just replaces it.
Signed-off-by: NWei 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: NPekka Enberg <penberg@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 422ff4d7
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册