stats: configurable page size
Type: improvement
Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c
index f6171db..cb6c7e3 100644
--- a/src/vppinfra/pmalloc.c
+++ b/src/vppinfra/pmalloc.c
@@ -288,10 +288,7 @@
if (a->flags & CLIB_PMALLOC_ARENA_F_SHARED_MEM)
{
mmap_flags |= MAP_SHARED;
- if (a->log2_subpage_sz != clib_mem_get_log2_page_size ())
- pm->error = clib_mem_create_hugetlb_fd ((char *) a->name, &a->fd);
- else
- pm->error = clib_mem_create_fd ((char *) a->name, &a->fd);
+ a->fd = clib_mem_vm_create_fd (a->log2_subpage_sz, "%s", a->name);
if (a->fd == -1)
goto error;
if ((ftruncate (a->fd, size)) == -1)