Tcache: Make incremental gc bytes configurable.
This commit is contained in:
committed by
David Goldblatt
parent
ec0b579563
commit
d338dd45d7
@@ -1389,6 +1389,10 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
|
||||
CONF_HANDLE_UNSIGNED(opt_tcache_nslots_large,
|
||||
"tcache_nslots_large", 1, 2048,
|
||||
CONF_CHECK_MIN, CONF_CHECK_MAX, /* clip */ true)
|
||||
CONF_HANDLE_SIZE_T(opt_tcache_gc_incr_bytes,
|
||||
"tcache_gc_incr_bytes", 1024, SIZE_T_MAX,
|
||||
CONF_CHECK_MIN, CONF_DONT_CHECK_MAX,
|
||||
/* clip */ true)
|
||||
|
||||
/*
|
||||
* The runtime option of oversize_threshold remains
|
||||
|
10
src/tcache.c
10
src/tcache.c
@@ -33,6 +33,12 @@ unsigned opt_tcache_nslots_large = 20;
|
||||
*/
|
||||
ssize_t opt_lg_tcache_nslots_mul = -1;
|
||||
|
||||
/*
|
||||
* Number of allocation bytes between tcache incremental GCs. Again, this
|
||||
* default just seems to work well; more tuning is possible.
|
||||
*/
|
||||
size_t opt_tcache_gc_incr_bytes = 65536;
|
||||
|
||||
cache_bin_info_t *tcache_bin_info;
|
||||
|
||||
/* Total stack size required (per tcache). Include the padding above. */
|
||||
@@ -62,7 +68,7 @@ tcache_salloc(tsdn_t *tsdn, const void *ptr) {
|
||||
|
||||
uint64_t
|
||||
tcache_gc_new_event_wait(tsd_t *tsd) {
|
||||
return TCACHE_GC_INCR_BYTES;
|
||||
return opt_tcache_gc_incr_bytes;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
@@ -72,7 +78,7 @@ tcache_gc_postponed_event_wait(tsd_t *tsd) {
|
||||
|
||||
uint64_t
|
||||
tcache_gc_dalloc_new_event_wait(tsd_t *tsd) {
|
||||
return TCACHE_GC_INCR_BYTES;
|
||||
return opt_tcache_gc_incr_bytes;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
Reference in New Issue
Block a user