aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-05-20 22:01:44 +0200
committerDamjan Marion <damarion@cisco.com>2020-05-20 22:01:44 +0200
commitef58758286e84d227377c447c7cf8fae82bdca94 (patch)
tree2bf2dd5acd8b2c733487f5749b95faa859bb225f /src/vlib/CMakeLists.txt
parentca86c95a3413214110a03b001d45d018385b92dc (diff)
vlib: mmap process stacks
Instead of allocating stack from the main heap, this patch mmaps stack memory together with guard page. This aproach reduces main heap usage, and stack memory is prefaulted on demand, so bigger process stacks will have zero impact on memory usage as long as stack memory is not needed for real. In addition, it fixes issue with systems which have bigger default page size (observed with 65536). Type: improvement Change-Id: I593365c603d4702e428967d80fd425fdee2c4a21 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/CMakeLists.txt')
-rw-r--r--src/vlib/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt
index 2846128ce93..8a31af68742 100644
--- a/src/vlib/CMakeLists.txt
+++ b/src/vlib/CMakeLists.txt
@@ -23,6 +23,18 @@ else()
endif()
set(PRE_DATA_SIZE 128 CACHE STRING "Buffer headroom size.")
+
+if (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")
+ set(_ss 16)
+else()
+ set(_ss 15)
+endif()
+set(VLIB_PROCESS_LOG2_STACK_SIZE
+ ${_ss}
+ CACHE
+ STRING "Process node default stack size (log2)"
+)
+
configure_file(
${CMAKE_SOURCE_DIR}/vlib/config.h.in
${CMAKE_BINARY_DIR}/vlib/config.h