aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Watson <davejwatson@fb.com>2018-03-29 12:58:13 -0700
committerDave Watson <davejwatson@fb.com>2018-04-10 14:01:45 -0700
commit8b14f3abc05f01419f9321a6a65ab9dd68dcebac (patch)
tree89bd0d868edc7d8337c02d7fa881ad1c61f2f497 /include
parent4be74d51121e8772d356e8be088dc93f927fd709 (diff)
downloadplatform_external_jemalloc_new-8b14f3abc05f01419f9321a6a65ab9dd68dcebac.tar.gz
platform_external_jemalloc_new-8b14f3abc05f01419f9321a6a65ab9dd68dcebac.tar.bz2
platform_external_jemalloc_new-8b14f3abc05f01419f9321a6a65ab9dd68dcebac.zip
background_thread: add max thread count config
Looking at the thread counts in our services, jemalloc's background thread is useful, but mostly idle. Add a config option to tune down the number of threads.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/background_thread_externs.h2
-rw-r--r--include/jemalloc/internal/background_thread_structs.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/jemalloc/internal/background_thread_externs.h b/include/jemalloc/internal/background_thread_externs.h
index 8b4b8471..3209aa49 100644
--- a/include/jemalloc/internal/background_thread_externs.h
+++ b/include/jemalloc/internal/background_thread_externs.h
@@ -2,9 +2,11 @@
#define JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H
extern bool opt_background_thread;
+extern size_t opt_max_background_threads;
extern malloc_mutex_t background_thread_lock;
extern atomic_b_t background_thread_enabled_state;
extern size_t n_background_threads;
+extern size_t max_background_threads;
extern background_thread_info_t *background_thread_info;
extern bool can_enable_background_thread;
diff --git a/include/jemalloc/internal/background_thread_structs.h b/include/jemalloc/internal/background_thread_structs.h
index e69a7d02..c1107dfe 100644
--- a/include/jemalloc/internal/background_thread_structs.h
+++ b/include/jemalloc/internal/background_thread_structs.h
@@ -8,6 +8,7 @@
#endif
#define BACKGROUND_THREAD_INDEFINITE_SLEEP UINT64_MAX
+#define MAX_BACKGROUND_THREAD_LIMIT MALLOCX_ARENA_LIMIT
typedef enum {
background_thread_stopped,