From f9f00df57663b06cb3eac3ce773c36da3a86f8aa Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Fri, 18 Oct 2019 19:02:17 -0400 Subject: [PATCH] Use vmalloc instead of kmalloc in mem pools Signed-off-by: Adam Rutkowski --- modules/cas_cache/utils/utils_mpool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/cas_cache/utils/utils_mpool.c b/modules/cas_cache/utils/utils_mpool.c index dfc6e0e..c3cc25f 100644 --- a/modules/cas_cache/utils/utils_mpool.c +++ b/modules/cas_cache/utils/utils_mpool.c @@ -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); }