From 9322123a9756ee98796f193dd30f582119e17b4c Mon Sep 17 00:00:00 2001 From: daan Date: Fri, 12 Nov 2021 19:32:57 -0800 Subject: [PATCH] start eager commit delay at N>2 --- src/options.c | 2 +- src/segment.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/options.c b/src/options.c index 21edd97c..e01e4665 100644 --- a/src/options.c +++ b/src/options.c @@ -89,7 +89,7 @@ static mi_option_desc_t options[_mi_option_last] = { 1, UNINIT, MI_OPTION(eager_commit_delay) }, // the first N segments per thread are not eagerly committed (but per page in the segment on demand) #endif { 1, UNINIT, MI_OPTION(allow_decommit) }, // decommit slices when no longer used (after reset_delay milli-seconds) - { 50, UNINIT, MI_OPTION(reset_delay) }, // page reset delay in milli-seconds (= decommit) + { 50, UNINIT, MI_OPTION(reset_delay) }, // page reset delay in milli-seconds (= decommit) { 500, UNINIT, MI_OPTION(segment_decommit_delay) },// decommit delay in milli-seconds for freed segments { 0, UNINIT, MI_OPTION(use_numa_nodes) }, // 0 = use available numa nodes, otherwise use at most N nodes. { 0, UNINIT, MI_OPTION(limit_os_alloc) }, // 1 = do not use OS memory for allocation (but only reserved arenas) diff --git a/src/segment.c b/src/segment.c index a37252f5..794a0541 100644 --- a/src/segment.c +++ b/src/segment.c @@ -656,7 +656,7 @@ static mi_segment_t* mi_segment_init(mi_segment_t* segment, size_t required, mi_ const size_t segment_size = segment_slices * MI_SEGMENT_SLICE_SIZE; // Commit eagerly only if not the first N lazy segments (to reduce impact of many threads that allocate just a little) - const bool eager_delay = (_mi_current_thread_count() > 4 && tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay)); + const bool eager_delay = (_mi_current_thread_count() > 2 && tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay)); const bool eager = !eager_delay && mi_option_is_enabled(mi_option_eager_commit); bool commit = eager || (required > 0);