Use vmalloc instead of kmalloc in mem pools

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2019-10-18 19:02:17 -04:00
parent e91e58ef66
commit f9f00df576

View File

@ -85,7 +85,9 @@ void *cas_mpool_new_f(struct cas_mpool *mpool, uint32_t count, int flags)
if (allocator)
items = env_allocator_new(allocator);
else
items = env_zalloc(mpool->hdr_size + (mpool->item_size * count), flags);
items = __vmalloc(mpool->hdr_size + (mpool->item_size * count),
flags | __GFP_ZERO | __GFP_HIGHMEM,
PAGE_KERNEL);
#ifdef ZERO_OR_NULL_PTR
if (ZERO_OR_NULL_PTR(items))
@ -110,5 +112,5 @@ void cas_mpool_del(struct cas_mpool *mpool,
if (allocator)
env_allocator_del(allocator, items);
else
env_free(items);
cas_vfree(items);
}