提交 b1e05416 编写于 作者: J Joonsoo Kim 提交者: 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: NChristoph Lameter <cl@linux.com>
Reported-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NJoonsoo Kim <js1304@gmail.com>
Signed-off-by: NPekka Enberg <penberg@kernel.org>
上级 db845067
......@@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags)
index = fls(size - 1);
#ifdef CONFIG_ZONE_DMA
if (unlikely((flags & SLAB_CACHE_DMA)))
if (unlikely((flags & GFP_DMA)))
return kmalloc_dma_caches[index];
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册