diff options
author | Qi Wang <interwq@gwu.edu> | 2017-11-03 00:48:39 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-11-03 20:53:33 (GMT) |
commit | e422fa8e7ea749ab8c4783e405c0f4b19ac25db9 (patch) | |
tree | 3c84baa27103dffe0282e597afe4581e6799476d /include/jemalloc/internal | |
parent | 9f455e2786685b443201c33119765c8093461174 (diff) | |
download | jemalloc-e422fa8e7ea749ab8c4783e405c0f4b19ac25db9.zip jemalloc-e422fa8e7ea749ab8c4783e405c0f4b19ac25db9.tar.gz jemalloc-e422fa8e7ea749ab8c4783e405c0f4b19ac25db9.tar.bz2 |
Add arena.i.retain_grow_limit
This option controls the max size when grow_retained. This is useful when we
have customized extent hooks reserving physical memory (e.g. 1G huge pages).
Without this feature, the default increasing sequence could result in fragmented
and wasted physical memory.
Diffstat (limited to 'include/jemalloc/internal')
-rw-r--r-- | include/jemalloc/internal/arena_externs.h | 2 | ||||
-rw-r--r-- | include/jemalloc/internal/arena_structs_b.h | 5 | ||||
-rw-r--r-- | include/jemalloc/internal/extent_types.h | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/jemalloc/internal/arena_externs.h b/include/jemalloc/internal/arena_externs.h index 4e546c3..5a0e3ad 100644 --- a/include/jemalloc/internal/arena_externs.h +++ b/include/jemalloc/internal/arena_externs.h @@ -77,6 +77,8 @@ ssize_t arena_dirty_decay_ms_default_get(void); bool arena_dirty_decay_ms_default_set(ssize_t decay_ms); ssize_t arena_muzzy_decay_ms_default_get(void); bool arena_muzzy_decay_ms_default_set(ssize_t decay_ms); +bool arena_retain_grow_limit_get_set(tsd_t *tsd, arena_t *arena, + size_t *old_limit, size_t *new_limit); unsigned arena_nthreads_get(arena_t *arena, bool internal); void arena_nthreads_inc(arena_t *arena, bool internal); void arena_nthreads_dec(arena_t *arena, bool internal); diff --git a/include/jemalloc/internal/arena_structs_b.h b/include/jemalloc/internal/arena_structs_b.h index c4e4310..f74ea97 100644 --- a/include/jemalloc/internal/arena_structs_b.h +++ b/include/jemalloc/internal/arena_structs_b.h @@ -240,9 +240,14 @@ struct arena_s { * be effective even if multiple arenas' extent allocation requests are * highly interleaved. * + * retain_grow_limit is the max allowed size ind to expand (unless the + * required size is greater). Default is no limit, and controlled + * through mallctl only. + * * Synchronization: extent_grow_mtx */ pszind_t extent_grow_next; + pszind_t retain_grow_limit; malloc_mutex_t extent_grow_mtx; /* diff --git a/include/jemalloc/internal/extent_types.h b/include/jemalloc/internal/extent_types.h index b6905ce..7efcd3a 100644 --- a/include/jemalloc/internal/extent_types.h +++ b/include/jemalloc/internal/extent_types.h @@ -6,4 +6,6 @@ typedef struct extents_s extents_t; #define EXTENT_HOOKS_INITIALIZER NULL +#define EXTENT_GROW_MAX_PIND (NPSIZES - 1) + #endif /* JEMALLOC_INTERNAL_EXTENT_TYPES_H */ |