Commit 7b55f620 authored by Christoph Lameter's avatar Christoph Lameter Committed by 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: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f1b26339
...@@ -2289,15 +2289,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) ...@@ -2289,15 +2289,7 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
if (!x) if (!x)
panic("Unable to allocate memory for dma cache\n"); panic("Unable to allocate memory for dma cache\n");
if (index <= KMALLOC_SHIFT_HIGH) realsize = kmalloc_caches[index].objsize;
realsize = 1 << index;
else {
if (index == 1)
realsize = 96;
else
realsize = 192;
}
text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d", text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d",
(unsigned int)realsize); (unsigned int)realsize);
s = create_kmalloc_cache(x, text, realsize, flags); s = create_kmalloc_cache(x, text, realsize, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment