[PATCH] acl: use rte_calloc for temporary memory allocation
From: Vladyslav Buslov <hidden>
Date: 2016-08-16 14:02:00
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Vladyslav Buslov <hidden>
Date: 2016-08-16 14:02:00
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
Acl build process uses significant amount of memory which degrades performance by causing page walks when memory is allocated on regular heap using libc calloc. This commit changes tb_mem to allocate temporary memory on huge pages with rte_calloc. Signed-off-by: Vladyslav Buslov <redacted> --- lib/librte_acl/tb_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_acl/tb_mem.c b/lib/librte_acl/tb_mem.c
index 157e608..c373673 100644
--- a/lib/librte_acl/tb_mem.c
+++ b/lib/librte_acl/tb_mem.c@@ -52,7 +52,7 @@ tb_pool(struct tb_mem_pool *pool, size_t sz) size_t size; size = sz + pool->alignment - 1; - block = calloc(1, size + sizeof(*pool->block)); + block = rte_calloc("ACL_TBMEM_BLOCK", 1, size + sizeof(*pool->block), 0); if (block == NULL) { RTE_LOG(ERR, MALLOC, "%s(%zu)\n failed, currently allocated " "by pool: %zu bytes\n", __func__, sz, pool->alloc);
--
2.8.3