Use vmalloc instead of kmalloc in mem pools
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
e91e58ef66
commit
f9f00df576
@ -85,7 +85,9 @@ void *cas_mpool_new_f(struct cas_mpool *mpool, uint32_t count, int flags)
|
|||||||
if (allocator)
|
if (allocator)
|
||||||
items = env_allocator_new(allocator);
|
items = env_allocator_new(allocator);
|
||||||
else
|
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
|
#ifdef ZERO_OR_NULL_PTR
|
||||||
if (ZERO_OR_NULL_PTR(items))
|
if (ZERO_OR_NULL_PTR(items))
|
||||||
@ -110,5 +112,5 @@ void cas_mpool_del(struct cas_mpool *mpool,
|
|||||||
if (allocator)
|
if (allocator)
|
||||||
env_allocator_del(allocator, items);
|
env_allocator_del(allocator, items);
|
||||||
else
|
else
|
||||||
env_free(items);
|
cas_vfree(items);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user