summaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm/ssvm.c')
-rw-r--r--src/svm/ssvm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c
index 9cdde128561..bf0a1361e4a 100644
--- a/src/svm/ssvm.c
+++ b/src/svm/ssvm.c
@@ -227,8 +227,12 @@ ssvm_server_init_memfd (ssvm_private_t * memfd)
ASSERT (vec_c_string_is_terminated (memfd->name));
- memfd->fd = clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT,
- (char *) memfd->name);
+ if (memfd->huge_page)
+ memfd->fd = clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT_HUGE,
+ (char *) memfd->name);
+ else
+ memfd->fd =
+ clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT, (char *) memfd->name);
if (memfd->fd == CLIB_MEM_ERROR)
{
@@ -270,7 +274,7 @@ ssvm_server_init_memfd (ssvm_private_t * memfd)
sh->ssvm_va = pointer_to_uword (sh);
sh->type = SSVM_SEGMENT_MEMFD;
- page_size = 1ULL << log2_page_size;
+ page_size = clib_mem_get_page_size ();
sh->heap = clib_mem_create_heap (((u8 *) sh) + page_size,
memfd->ssvm_size - page_size,
1 /* locked */ , "ssvm server memfd");