Rename huge_threshold to oversize_threshold.
The keyword huge tend to remind people of huge pages which is not relevent to the feature.
This commit is contained in:
14
src/arena.c
14
src/arena.c
@@ -43,8 +43,8 @@ const uint64_t h_steps[SMOOTHSTEP_NSTEPS] = {
|
||||
|
||||
static div_info_t arena_binind_div_info[SC_NBINS];
|
||||
|
||||
size_t opt_huge_threshold = HUGE_THRESHOLD_DEFAULT;
|
||||
size_t huge_threshold = HUGE_THRESHOLD_DEFAULT;
|
||||
size_t opt_oversize_threshold = OVERSIZE_THRESHOLD_DEFAULT;
|
||||
size_t oversize_threshold = OVERSIZE_THRESHOLD_DEFAULT;
|
||||
static unsigned huge_arena_ind;
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -2112,15 +2112,15 @@ arena_init_huge(void) {
|
||||
bool huge_enabled;
|
||||
|
||||
/* The threshold should be large size class. */
|
||||
if (opt_huge_threshold > SC_LARGE_MAXCLASS ||
|
||||
opt_huge_threshold < SC_LARGE_MINCLASS) {
|
||||
opt_huge_threshold = 0;
|
||||
huge_threshold = SC_LARGE_MAXCLASS + PAGE;
|
||||
if (opt_oversize_threshold > SC_LARGE_MAXCLASS ||
|
||||
opt_oversize_threshold < SC_LARGE_MINCLASS) {
|
||||
opt_oversize_threshold = 0;
|
||||
oversize_threshold = SC_LARGE_MAXCLASS + PAGE;
|
||||
huge_enabled = false;
|
||||
} else {
|
||||
/* Reserve the index for the huge arena. */
|
||||
huge_arena_ind = narenas_total_get();
|
||||
huge_threshold = opt_huge_threshold;
|
||||
oversize_threshold = opt_oversize_threshold;
|
||||
huge_enabled = true;
|
||||
}
|
||||
|
||||
|
@@ -85,7 +85,7 @@ CTL_PROTO(opt_retain)
|
||||
CTL_PROTO(opt_dss)
|
||||
CTL_PROTO(opt_narenas)
|
||||
CTL_PROTO(opt_percpu_arena)
|
||||
CTL_PROTO(opt_huge_threshold)
|
||||
CTL_PROTO(opt_oversize_threshold)
|
||||
CTL_PROTO(opt_background_thread)
|
||||
CTL_PROTO(opt_max_background_threads)
|
||||
CTL_PROTO(opt_dirty_decay_ms)
|
||||
@@ -300,7 +300,7 @@ static const ctl_named_node_t opt_node[] = {
|
||||
{NAME("dss"), CTL(opt_dss)},
|
||||
{NAME("narenas"), CTL(opt_narenas)},
|
||||
{NAME("percpu_arena"), CTL(opt_percpu_arena)},
|
||||
{NAME("huge_threshold"), CTL(opt_huge_threshold)},
|
||||
{NAME("oversize_threshold"), CTL(opt_oversize_threshold)},
|
||||
{NAME("background_thread"), CTL(opt_background_thread)},
|
||||
{NAME("max_background_threads"), CTL(opt_max_background_threads)},
|
||||
{NAME("dirty_decay_ms"), CTL(opt_dirty_decay_ms)},
|
||||
@@ -1716,7 +1716,7 @@ CTL_RO_NL_GEN(opt_dss, opt_dss, const char *)
|
||||
CTL_RO_NL_GEN(opt_narenas, opt_narenas, unsigned)
|
||||
CTL_RO_NL_GEN(opt_percpu_arena, percpu_arena_mode_names[opt_percpu_arena],
|
||||
const char *)
|
||||
CTL_RO_NL_GEN(opt_huge_threshold, opt_huge_threshold, size_t)
|
||||
CTL_RO_NL_GEN(opt_oversize_threshold, opt_oversize_threshold, size_t)
|
||||
CTL_RO_NL_GEN(opt_background_thread, opt_background_thread, bool)
|
||||
CTL_RO_NL_GEN(opt_max_background_threads, opt_max_background_threads, size_t)
|
||||
CTL_RO_NL_GEN(opt_dirty_decay_ms, opt_dirty_decay_ms, ssize_t)
|
||||
|
@@ -1240,15 +1240,15 @@ malloc_conf_init(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS]) {
|
||||
-1, (sizeof(size_t) << 3) - 1)
|
||||
|
||||
/*
|
||||
* The runtime option of huge_threshold remains
|
||||
* The runtime option of oversize_threshold remains
|
||||
* undocumented. It may be tweaked in the next major
|
||||
* release (6.0). The default value 8M is rather
|
||||
* conservative / safe. Tuning it further down may
|
||||
* improve fragmentation a bit more, but may also cause
|
||||
* contention on the huge arena.
|
||||
*/
|
||||
CONF_HANDLE_SIZE_T(opt_huge_threshold,
|
||||
"huge_threshold", SC_LARGE_MINCLASS,
|
||||
CONF_HANDLE_SIZE_T(opt_oversize_threshold,
|
||||
"oversize_threshold", SC_LARGE_MINCLASS,
|
||||
SC_LARGE_MAXCLASS, yes, yes, false)
|
||||
CONF_HANDLE_SIZE_T(opt_lg_extent_max_active_fit,
|
||||
"lg_extent_max_active_fit", 0,
|
||||
|
@@ -1028,7 +1028,7 @@ stats_general_print(emitter_t *emitter) {
|
||||
OPT_WRITE_CHAR_P("dss")
|
||||
OPT_WRITE_UNSIGNED("narenas")
|
||||
OPT_WRITE_CHAR_P("percpu_arena")
|
||||
OPT_WRITE_SIZE_T("huge_threshold")
|
||||
OPT_WRITE_SIZE_T("oversize_threshold")
|
||||
OPT_WRITE_CHAR_P("metadata_thp")
|
||||
OPT_WRITE_BOOL_MUTABLE("background_thread", "background_thread")
|
||||
OPT_WRITE_SSIZE_T_MUTABLE("dirty_decay_ms", "arenas.dirty_decay_ms")
|
||||
|
Reference in New Issue
Block a user