summaryrefslogtreecommitdiff
path: root/deps/jemalloc/include/jemalloc/internal/stats.h
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2023-05-07 17:41:17 +0300
committerGitHub <noreply@github.com>2023-05-07 17:41:17 +0300
commit07d54dc5baa1b2e7adb5ce8e7bee398d376fe13b (patch)
treebd5b11001e44bac9cc2100dfae0af96c31bc4e99 /deps/jemalloc/include/jemalloc/internal/stats.h
parent42dd98ec191fd71528785bd7d31bd18112078f66 (diff)
parent0897c8afedc210db5f827bed9d225f24011245eb (diff)
downloadredis-07d54dc5baa1b2e7adb5ce8e7bee398d376fe13b.tar.gz
Merge pull request #12115 from oranagra/update_jemalloc_5_3_0
Upgrade to jemalloc 5.3.0 hoping to resolve a potential for deadlock in a fork child see https://github.com/jemalloc/jemalloc/issues/2402 steps: * Upgrade subtree according to the instructions in deps/README * update iget_defrag_hint by following changes to arena_dalloc_no_tcache
Diffstat (limited to 'deps/jemalloc/include/jemalloc/internal/stats.h')
-rw-r--r--deps/jemalloc/include/jemalloc/internal/stats.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/deps/jemalloc/include/jemalloc/internal/stats.h b/deps/jemalloc/include/jemalloc/internal/stats.h
index 3b9e0eac1..727f7dcbd 100644
--- a/deps/jemalloc/include/jemalloc/internal/stats.h
+++ b/deps/jemalloc/include/jemalloc/internal/stats.h
@@ -11,7 +11,8 @@
OPTION('b', bins, true, false) \
OPTION('l', large, true, false) \
OPTION('x', mutex, true, false) \
- OPTION('e', extents, true, false)
+ OPTION('e', extents, true, false) \
+ OPTION('h', hpa, config_stats, false)
enum {
#define OPTION(o, v, d, s) stats_print_option_num_##v,
@@ -24,8 +25,30 @@ enum {
extern bool opt_stats_print;
extern char opt_stats_print_opts[stats_print_tot_num_options+1];
+/* Utilities for stats_interval. */
+extern int64_t opt_stats_interval;
+extern char opt_stats_interval_opts[stats_print_tot_num_options+1];
+
+#define STATS_INTERVAL_DEFAULT -1
+/*
+ * Batch-increment the counter to reduce synchronization overhead. Each thread
+ * merges after (interval >> LG_BATCH_SIZE) bytes of allocations; also limit the
+ * BATCH_MAX for accuracy when the interval is huge (which is expected).
+ */
+#define STATS_INTERVAL_ACCUM_LG_BATCH_SIZE 6
+#define STATS_INTERVAL_ACCUM_BATCH_MAX (4 << 20)
+
+/* Only accessed by thread event. */
+uint64_t stats_interval_new_event_wait(tsd_t *tsd);
+uint64_t stats_interval_postponed_event_wait(tsd_t *tsd);
+void stats_interval_event_handler(tsd_t *tsd, uint64_t elapsed);
+
/* Implements je_malloc_stats_print. */
-void stats_print(void (*write_cb)(void *, const char *), void *cbopaque,
- const char *opts);
+void stats_print(write_cb_t *write_cb, void *cbopaque, const char *opts);
+
+bool stats_boot(void);
+void stats_prefork(tsdn_t *tsdn);
+void stats_postfork_parent(tsdn_t *tsdn);
+void stats_postfork_child(tsdn_t *tsdn);
#endif /* JEMALLOC_INTERNAL_STATS_H */