diff options
author | Qi Wang <interwq@gwu.edu> | 2017-06-15 01:44:13 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-06-15 03:18:02 (GMT) |
commit | 84f6c2cae0fb1399377ef6aea9368444c4987cc6 (patch) | |
tree | 5291cba137446b8923883ba2e4f78254c6033a6d /src/arena.c | |
parent | a4d6fe73cf07b3be3af6b7811cfc5950320bb37f (diff) | |
download | jemalloc-84f6c2cae0fb1399377ef6aea9368444c4987cc6.zip jemalloc-84f6c2cae0fb1399377ef6aea9368444c4987cc6.tar.gz jemalloc-84f6c2cae0fb1399377ef6aea9368444c4987cc6.tar.bz2 |
Log decay->nunpurged before purging.
During purging, we may unlock decay->mtx. Therefore we should finish logging
decay related counters before attempt to purge.
Diffstat (limited to 'src/arena.c')
-rw-r--r-- | src/arena.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arena.c b/src/arena.c index 0912df3..019dd87 100644 --- a/src/arena.c +++ b/src/arena.c @@ -725,12 +725,13 @@ arena_decay_epoch_advance(tsdn_t *tsdn, arena_t *arena, arena_decay_t *decay, arena_decay_epoch_advance_helper(decay, time, current_npages); size_t npages_limit = arena_decay_backlog_npages_limit(decay); + /* We may unlock decay->mtx when try_purge(). Finish logging first. */ + decay->nunpurged = (npages_limit > current_npages) ? npages_limit : + current_npages; if (purge) { arena_decay_try_purge(tsdn, arena, decay, extents, current_npages, npages_limit); } - decay->nunpurged = (npages_limit > current_npages) ? npages_limit : - current_npages; } static void |