Commit f9ec6ecf by FritzFlorian

Touch all stack memory in scheduler.

parent 616964f6
Pipeline #1496 failed with stages
in 54 seconds
......@@ -68,12 +68,14 @@ if (PLS_PROFILER)
else ()
set(PLS_PROFILING_ENABLED false)
endif ()
message("-- PLS Profiler: ${PLS_PROFILER}")
option(SLEEP_WORKERS "Enable sleeping workers if queues are empty" OFF)
if (SLEEP_WORKERS)
set(PLS_SLEEP_WORKERS_ON_EMPTY true)
else ()
set(PLS_SLEEP_WORKERS_ON_EMPTY false)
endif ()
message("-- Sleep Workers: ${SLEEP_WORKERS}")
configure_file(include/pls/internal/build_flavour.h.in include/pls/internal/build_flavour.h)
......
......@@ -16,6 +16,9 @@ task_manager::task_manager(unsigned thread_id,
for (size_t i = 0; i < num_tasks; i++) {
char *stack_memory = stack_allocator->allocate_stack(stack_size);
for (size_t j = 0; j < stack_size; j += base::system_details::CACHE_LINE_SIZE) {
stack_memory[j] = 'a'; // Touch all stacks, forces the OS to actually allocate them
}
tasks_.emplace_back(std::make_unique<task>(stack_memory, stack_size, i, thread_id));
if (i > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment