summaryrefslogtreecommitdiffstats
path: root/src/svm
diff options
context:
space:
mode:
authorJunfeng Wang <drenfong.wang@intel.com>2022-08-12 16:24:46 +0800
committerFlorin Coras <florin.coras@gmail.com>2022-09-15 23:15:26 +0000
commitc795b8836d83b4b062aa21423f842aa765269c2c (patch)
tree9c7f9835da485443b4a43477e706178661399bdd /src/svm
parent0654242d1ef51566f0d58445a16053cf376e5a6e (diff)
vcl: add hugepage for vcl configure and svm
add hugepage for vcl configure and svm Type: feature Signed-off-by: Junfeng Wang <drenfong.wang@intel.com> Change-Id: I6a8905e3fec23d840e629114b1e5a403d0a258ef
Diffstat (limited to 'src/svm')
-rw-r--r--src/svm/ssvm.c10
-rw-r--r--src/svm/ssvm.h2
2 files changed, 8 insertions, 4 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");
diff --git a/src/svm/ssvm.h b/src/svm/ssvm.h
index 9bd16a9b462..ef982a1b304 100644
--- a/src/svm/ssvm.h
+++ b/src/svm/ssvm.h
@@ -87,7 +87,7 @@ typedef struct
u8 *name;
u8 numa; /**< UNUSED: numa requested at alloc time */
int is_server;
-
+ int huge_page;
union
{
int fd; /**< memfd segments */