summaryrefslogtreecommitdiff
path: root/deps/jemalloc/include/jemalloc/internal/bin_info.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/bin_info.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/bin_info.h')
-rw-r--r--deps/jemalloc/include/jemalloc/internal/bin_info.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/deps/jemalloc/include/jemalloc/internal/bin_info.h b/deps/jemalloc/include/jemalloc/internal/bin_info.h
new file mode 100644
index 000000000..7fe65c866
--- /dev/null
+++ b/deps/jemalloc/include/jemalloc/internal/bin_info.h
@@ -0,0 +1,50 @@
+#ifndef JEMALLOC_INTERNAL_BIN_INFO_H
+#define JEMALLOC_INTERNAL_BIN_INFO_H
+
+#include "jemalloc/internal/bitmap.h"
+
+/*
+ * Read-only information associated with each element of arena_t's bins array
+ * is stored separately, partly to reduce memory usage (only one copy, rather
+ * than one per arena), but mainly to avoid false cacheline sharing.
+ *
+ * Each slab has the following layout:
+ *
+ * /--------------------\
+ * | region 0 |
+ * |--------------------|
+ * | region 1 |
+ * |--------------------|
+ * | ... |
+ * | ... |
+ * | ... |
+ * |--------------------|
+ * | region nregs-1 |
+ * \--------------------/
+ */
+typedef struct bin_info_s bin_info_t;
+struct bin_info_s {
+ /* Size of regions in a slab for this bin's size class. */
+ size_t reg_size;
+
+ /* Total size of a slab for this bin's size class. */
+ size_t slab_size;
+
+ /* Total number of regions in a slab for this bin's size class. */
+ uint32_t nregs;
+
+ /* Number of sharded bins in each arena for this size class. */
+ uint32_t n_shards;
+
+ /*
+ * Metadata used to manipulate bitmaps for slabs associated with this
+ * bin.
+ */
+ bitmap_info_t bitmap_info;
+};
+
+extern bin_info_t bin_infos[SC_NBINS];
+
+void bin_info_boot(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS]);
+
+#endif /* JEMALLOC_INTERNAL_BIN_INFO_H */