Tcache: Make incremental gc bytes configurable.

This commit is contained in:
David Goldblatt
2020-05-11 15:53:30 -07:00
committed by David Goldblatt
parent ec0b579563
commit d338dd45d7
6 changed files with 15 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ extern unsigned opt_tcache_nslots_small_min;
extern unsigned opt_tcache_nslots_small_max;
extern unsigned opt_tcache_nslots_large;
extern ssize_t opt_lg_tcache_shift;
extern size_t opt_tcache_gc_incr_bytes;
/*
* Number of tcache bins. There are SC_NBINS small-object bins, plus 0 or more

View File

@@ -17,9 +17,6 @@ typedef struct tcaches_s tcaches_t;
#define TCACHE_STATE_PURGATORY ((tcache_t *)(uintptr_t)3)
#define TCACHE_STATE_MAX TCACHE_STATE_PURGATORY
/* Number of allocation bytes between tcache incremental GCs. */
#define TCACHE_GC_INCR_BYTES 65536U
/* Used in TSD static initializer only. Real init in tsd_tcache_data_init(). */
#define TCACHE_ZERO_INITIALIZER {0}
#define TCACHE_SLOW_ZERO_INITIALIZER {0}

View File

@@ -53,10 +53,10 @@ void tsd_te_init(tsd_t *tsd);
* E(event, (condition), is_alloc_event)
*/
#define ITERATE_OVER_ALL_EVENTS \
E(tcache_gc, (TCACHE_GC_INCR_BYTES > 0), true) \
E(tcache_gc, (opt_tcache_gc_incr_bytes > 0), true) \
E(prof_sample, (config_prof && opt_prof), true) \
E(stats_interval, (opt_stats_interval >= 0), true) \
E(tcache_gc_dalloc, (TCACHE_GC_INCR_BYTES > 0), false)
E(tcache_gc_dalloc, (opt_tcache_gc_incr_bytes > 0), false)
#define E(event, condition_unused, is_alloc_event_unused) \
C(event##_event_wait)