SUB: Fix dma index -> size calculation Size calculation is wrong for small dma slabs. Guess no one is using small dma slabs since no one noticed so far. Fix this by not calculating the size anymore but simply lookup the size of the dma slab in the regular kmalloc array. Signed-off-by: Christoph Lameter --- mm/slub.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) Index: linux-2.6.22-rc4-mm2/mm/slub.c =================================================================== --- linux-2.6.22-rc4-mm2.orig/mm/slub.c 2007-06-23 12:05:36.000000000 -0700 +++ linux-2.6.22-rc4-mm2/mm/slub.c 2007-06-23 12:05:46.000000000 -0700 @@ -2481,15 +2481,7 @@ static noinline struct kmem_cache *dma_k 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);