You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RM_HashSet in module.c. Seems func "hashTypeTryConversion" is not called so even ht encoding should be used (either length or element size limit is reached), data is still ziplist encoded.
Seems func hincrbyCommand and hincrbyfloatCommand (in t_hash.c) also missing the call, not sure if it is intended.
The impact is defrag not worked as expected as those ptr will skip moving/compacting because they could be allocated in large bin/run (otherwise in small bin/run, depends on jemalloc's "tcache_maxclass" variable in jemalloc lib, tcache.c), and defrag skip moving for such case, i.e, je_get_defrag_hint return 0. So in our case, defrag keep running but no progress made.
Also I guess that might cause perf issue when size of the ziplist is large.
JEMALLOC_EXPORT int JEMALLOC_NOTHROW
je_get_defrag_hint(void* ptr, int *bin_util, int *run_util) {
int defrag = 0;
arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (likely(chunk != ptr)) { /* indication that this is not a HUGE alloc */
size_t pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
size_t mapbits = arena_mapbits_get(chunk, pageind);
if (likely((mapbits & CHUNK_MAP_LARGE) == 0)) { /* indication that this is not a LARGE alloc */
arena_t *arena = extent_node_arena_get(&chunk->node);
size_t rpages_ind = pageind - arena_mapbits_small_runind_get(chunk, pageind);
arena_run_t *run = &arena_miscelm_get_mutable(chunk, rpages_ind)->run;
arena_bin_t *bin = &arena->bins[run->binind];
tsd_t *tsd = tsd_fetch();
malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock);
/* runs that are in the same chunk in as the current chunk, are likely to be the next currun */
if (chunk != (arena_chunk_t *)CHUNK_ADDR2BASE(bin->runcur)) {
arena_bin_info_t *bin_info = &arena_bin_info[run->binind];
size_t availregs = bin_info->nregs * bin->stats.curruns;
*bin_util = (bin->stats.curregs<<16) / availregs;
*run_util = ((bin_info->nregs - run->nfree)<<16) / bin_info->nregs;
defrag = 1;
}
malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock);
}
}
return defrag;
}
The text was updated successfully, but these errors were encountered:
RM_HashSet in module.c. Seems func "hashTypeTryConversion" is not called so even ht encoding should be used (either length or element size limit is reached), data is still ziplist encoded.
Seems func hincrbyCommand and hincrbyfloatCommand (in t_hash.c) also missing the call, not sure if it is intended.
The impact is defrag not worked as expected as those ptr will skip moving/compacting because they could be allocated in large bin/run (otherwise in small bin/run, depends on jemalloc's "tcache_maxclass" variable in jemalloc lib, tcache.c), and defrag skip moving for such case, i.e, je_get_defrag_hint return 0. So in our case, defrag keep running but no progress made.
Also I guess that might cause perf issue when size of the ziplist is large.
The text was updated successfully, but these errors were encountered: