Commit b1e05416 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Pekka Enberg

mm/sl[au]b: correct allocation type check in kmalloc_slab()

commit "slab: Common Kmalloc cache determination" made mistake
in kmalloc_slab(). SLAB_CACHE_DMA is for kmem_cache creation,
not for allocation. For allocation, we should use GFP_XXX to identify
type of allocation. So, change SLAB_CACHE_DMA to GFP_DMA.
Acked-by: default avatarChristoph Lameter <cl@linux.com>
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarJoonsoo Kim <js1304@gmail.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent db845067
...@@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) ...@@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
index = fls(size - 1); index = fls(size - 1);
#ifdef CONFIG_ZONE_DMA #ifdef CONFIG_ZONE_DMA
if (unlikely((flags & SLAB_CACHE_DMA))) if (unlikely((flags & GFP_DMA)))
return kmalloc_dma_caches[index]; return kmalloc_dma_caches[index];
#endif #endif
......
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