aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2018-02-16 14:19:19 -0800
committerQi Wang <interwq@gmail.com>2018-03-08 13:08:06 -0800
commite4f090e8df5adf180662c5eeac2af214f9594de4 (patch)
treec28d30deba0a47dc7882910ae98eae625ef7e43a /include
parentefa40532dc0fc000345086757ecaf8875313a012 (diff)
downloadplatform_external_jemalloc_new-e4f090e8df5adf180662c5eeac2af214f9594de4.tar.gz
platform_external_jemalloc_new-e4f090e8df5adf180662c5eeac2af214f9594de4.tar.bz2
platform_external_jemalloc_new-e4f090e8df5adf180662c5eeac2af214f9594de4.zip
Add opt.thp which allows explicit hugepage usage.
"always" marks all user mappings as MADV_HUGEPAGE; while "never" marks all mappings as MADV_NOHUGEPAGE. The default setting "default" does not change any settings. Note that all the madvise calls are part of the default extent hooks by design, so that customized extent hooks have complete control over the mappings including hugepage settings.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/pages.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/jemalloc/internal/pages.h b/include/jemalloc/internal/pages.h
index dff20515..7dae633a 100644
--- a/include/jemalloc/internal/pages.h
+++ b/include/jemalloc/internal/pages.h
@@ -58,8 +58,19 @@ static const bool pages_can_purge_forced =
#endif
;
-/* Whether transparent huge page state is "madvise". */
-extern bool thp_state_madvise;
+typedef enum {
+ thp_mode_default = 0, /* Do not change hugepage settings. */
+ thp_mode_always = 1, /* Always set MADV_HUGEPAGE. */
+ thp_mode_never = 2, /* Always set MADV_NOHUGEPAGE. */
+
+ thp_mode_names_limit = 3, /* Used for option processing. */
+ thp_mode_not_supported = 3 /* No THP support detected. */
+} thp_mode_t;
+
+#define THP_MODE_DEFAULT thp_mode_default
+extern thp_mode_t opt_thp;
+extern thp_mode_t init_system_thp_mode; /* Initial system wide state. */
+extern const char *thp_mode_names[];
void *pages_map(void *addr, size_t size, size_t alignment, bool *commit);
void pages_unmap(void *addr, size_t size);
@@ -72,5 +83,6 @@ bool pages_nohuge(void *addr, size_t size);
bool pages_dontdump(void *addr, size_t size);
bool pages_dodump(void *addr, size_t size);
bool pages_boot(void);
+void pages_set_thp_state (void *ptr, size_t size);
#endif /* JEMALLOC_INTERNAL_PAGES_EXTERNS_H */