提交 7b55f620 编写于 作者: C Christoph Lameter 提交者: Linus Torvalds

SLUB: Simplify dma index -> size calculation

There is no need to caculate the dma slab size ourselves. We can simply
lookup the size of the corresponding non dma slab.
Signed-off-by: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f1b26339
......@@ -2289,15 +2289,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
if (!x)
panic("Unable to allocate memory for dma cache\n");
if (index <= KMALLOC_SHIFT_HIGH)
realsize = 1 << index;
else {
if (index == 1)
realsize = 96;
else
realsize = 192;
}
realsize = kmalloc_caches[index].objsize;
text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d",
(unsigned int)realsize);
s = create_kmalloc_cache(x, text, realsize, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册