mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-25 21:35:42 +03:00
Implement opt.metadata_thp
This option enables transparent huge page for base allocators (require MADV_HUGEPAGE support).
This commit is contained in:
parent
d157864027
commit
8fdd9a5797
12 changed files with 118 additions and 17 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -260,6 +260,12 @@
|
|||
/* Defined if madvise(2) is available. */
|
||||
#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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue