summaryrefslogtreecommitdiffstats
path: root/src/tcache.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-02-20 04:09:31 (GMT)
committerJason Evans <jasone@canonware.com>2016-02-20 04:56:21 (GMT)
commit243f7a0508bb014c2a7bf592c466a923911db234 (patch)
treed24430fc0cdeea55d2028c8270925df283f8d274 /src/tcache.c
parent8e82af1166242bebd29289d2b16ce447273b427a (diff)
downloadjemalloc-243f7a0508bb014c2a7bf592c466a923911db234.zip
jemalloc-243f7a0508bb014c2a7bf592c466a923911db234.tar.gz
jemalloc-243f7a0508bb014c2a7bf592c466a923911db234.tar.bz2
Implement decay-based unused dirty page purging.
This is an alternative to the existing ratio-based unused dirty page purging, and is intended to eventually become the sole purging mechanism. Add mallctls: - opt.purge - opt.decay_time - arena.<i>.decay - arena.<i>.decay_time - arenas.decay_time - stats.arenas.<i>.decay_time This resolves #325.
Diffstat (limited to 'src/tcache.c')
-rw-r--r--src/tcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tcache.c b/src/tcache.c
index e8c3152..426bb1f 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -75,7 +75,7 @@ tcache_alloc_small_hard(tsd_t *tsd, arena_t *arena, tcache_t *tcache,
{
void *ret;
- arena_tcache_fill_small(arena, tbin, binind, config_prof ?
+ arena_tcache_fill_small(tsd, arena, tbin, binind, config_prof ?
tcache->prof_accumbytes : 0);
if (config_prof)
tcache->prof_accumbytes = 0;
@@ -143,6 +143,7 @@ tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin,
}
}
malloc_mutex_unlock(&bin->lock);
+ arena_decay_ticks(tsd, bin_arena, nflush - ndeferred);
}
if (config_stats && !merged_stats) {
/*
@@ -226,6 +227,7 @@ tcache_bin_flush_large(tsd_t *tsd, tcache_bin_t *tbin, szind_t binind,
malloc_mutex_unlock(&locked_arena->lock);
if (config_prof && idump)
prof_idump();
+ arena_decay_ticks(tsd, locked_arena, nflush - ndeferred);
}
if (config_stats && !merged_stats) {
/*