aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/pmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/pmalloc.c')
-rw-r--r--src/vppinfra/pmalloc.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c
index 0f9df9c6641..a8b47d74c9b 100644
--- a/src/vppinfra/pmalloc.c
+++ b/src/vppinfra/pmalloc.c
@@ -55,26 +55,12 @@ pmalloc_validate_numa_node (u32 * numa_node)
int
clib_pmalloc_init (clib_pmalloc_main_t * pm, uword size)
{
- struct stat st;
uword off, pagesize;
- int fd;
ASSERT (pm->error == 0);
- pm->log2_page_sz = 21;
- pm->error = clib_mem_create_hugetlb_fd ("detect_hugepage_size", &fd);
-
- if (pm->error)
- return -1;
-
- if (fd != -1)
- {
- if (fstat (fd, &st) == -1)
- pm->log2_page_sz = min_log2 (st.st_blksize);
- close (fd);
- }
-
- pagesize = 1ULL << pm->log2_page_sz;
+ pagesize = clib_mem_get_default_hugepage_size ();
+ pm->log2_page_sz = min_log2 (pagesize);
size = size ? size : ((u64) DEFAULT_RESERVED_MB) << 20;
size = round_pow2 (size, pagesize);