diff options
author | Qi Wang <interwq@gwu.edu> | 2017-08-10 20:14:26 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-08-11 21:51:20 (GMT) |
commit | 8fdd9a579779b84d6af27f94c295f82a4df8e5be (patch) | |
tree | 69816fe49c5e134f176020f05390df0cb82afccc /include | |
parent | d157864027562dc17475edfd1bc6dce559b7ac4b (diff) | |
download | jemalloc-8fdd9a579779b84d6af27f94c295f82a4df8e5be.zip jemalloc-8fdd9a579779b84d6af27f94c295f82a4df8e5be.tar.gz jemalloc-8fdd9a579779b84d6af27f94c295f82a4df8e5be.tar.bz2 |
Implement opt.metadata_thp
This option enables transparent huge page for base allocators (require
MADV_HUGEPAGE support).
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/base_externs.h | 2 | ||||
-rw-r--r-- | include/jemalloc/internal/base_types.h | 2 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal_defs.h.in | 6 | ||||
-rw-r--r-- | include/jemalloc/internal/pages.h | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/jemalloc/internal/base_externs.h b/include/jemalloc/internal/base_externs.h index a4fd5ac..a5cb8a8 100644 --- a/include/jemalloc/internal/base_externs.h +++ b/include/jemalloc/internal/base_externs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_BASE_EXTERNS_H #define JEMALLOC_INTERNAL_BASE_EXTERNS_H +extern bool opt_metadata_thp; + base_t *b0get(void); base_t *base_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks); void base_delete(tsdn_t *tsdn, base_t *base); diff --git a/include/jemalloc/internal/base_types.h b/include/jemalloc/internal/base_types.h index be7ee82..6e71033 100644 --- a/include/jemalloc/internal/base_types.h +++ b/include/jemalloc/internal/base_types.h @@ -4,4 +4,6 @@ typedef struct base_block_s base_block_t; typedef struct base_s base_t; +#define METADATA_THP_DEFAULT false + #endif /* JEMALLOC_INTERNAL_BASE_TYPES_H */ diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h.in b/include/jemalloc/internal/jemalloc_internal_defs.h.in index b73daf0..5fa7f51 100644 --- a/include/jemalloc/internal/jemalloc_internal_defs.h.in +++ b/include/jemalloc/internal/jemalloc_internal_defs.h.in @@ -261,6 +261,12 @@ #undef JEMALLOC_HAVE_MADVISE /* + * Defined if transparent huge pages are supported via the MADV_[NO]HUGEPAGE + * arguments to madvise(2). + */ +#undef JEMALLOC_HAVE_MADVISE_HUGE + +/* * Methods for purging unused pages differ between operating systems. * * madvise(..., MADV_FREE) : This marks pages as being unused, such that they diff --git a/include/jemalloc/internal/pages.h b/include/jemalloc/internal/pages.h index 28383b7..121fff3 100644 --- a/include/jemalloc/internal/pages.h +++ b/include/jemalloc/internal/pages.h @@ -58,6 +58,9 @@ static const bool pages_can_purge_forced = #endif ; +/* Whether transparent huge page state is "madvise". */ +extern bool thp_state_madvise; + void *pages_map(void *addr, size_t size, size_t alignment, bool *commit); void pages_unmap(void *addr, size_t size); bool pages_commit(void *addr, size_t size); |