diff options
author | Qi Wang <interwq@gwu.edu> | 2017-07-31 20:01:07 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-07-31 21:04:17 (GMT) |
commit | 3800e55a2c6f4ffb03242db06437ad371db4ccd8 (patch) | |
tree | eaad26fa448fa30027d823b5d26db0e844fedf1d | |
parent | 2d2fa72647e0e535088793a0335d0294277d2f09 (diff) | |
download | jemalloc-3800e55a2c6f4ffb03242db06437ad371db4ccd8.zip jemalloc-3800e55a2c6f4ffb03242db06437ad371db4ccd8.tar.gz jemalloc-3800e55a2c6f4ffb03242db06437ad371db4ccd8.tar.bz2 |
Bypass extent_alloc_wrapper_hard for no_move_expand.
When retain is enabled, we should not attempt mmap for in-place expansion
(large_ralloc_no_move), because it's virtually impossible to succeed, and causes
unnecessary syscalls (which can cause lock contention under load).
-rw-r--r-- | src/extent.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/extent.c b/src/extent.c index fa45c84..f464de4 100644 --- a/src/extent.c +++ b/src/extent.c @@ -1296,6 +1296,15 @@ extent_alloc_wrapper(tsdn_t *tsdn, arena_t *arena, extent_t *extent = extent_alloc_retained(tsdn, arena, r_extent_hooks, new_addr, size, pad, alignment, slab, szind, zero, commit); if (extent == NULL) { + if (opt_retain && new_addr != NULL) { + /* + * When retain is enabled and new_addr is set, we do not + * attempt extent_alloc_wrapper_hard which does mmap + * that is very unlikely to succeed (unless it happens + * to be at the end). + */ + return NULL; + } extent = extent_alloc_wrapper_hard(tsdn, arena, r_extent_hooks, new_addr, size, pad, alignment, slab, szind, zero, commit); } |