Make tcache GC interval configurable - #3003
Open
suyashmahar wants to merge 2 commits into
Open
suyashmahar wants to merge 2 commits into
suyashmahar wants to merge 2 commits into
Conversation
Replace the hard-coded 10ms TCACHE_GC_INTERVAL_NS with an opt.tcache_gc_interval_ms startup option plus a writable tcache.gc_interval_ms mallctl for run-time tuning. The live value is kept in ms and converted to ns on the GC path, so large intervals cannot overflow size_t on 32-bit platforms. Stats output shows both the boot and live values via OPT_WRITE_SIZE_T_MUTABLE. Test Plan: Built lib/libjemalloc.so.2 clean; test/unit/mallctl passes (189/204 pass, 15 skip, 0 fail) including new test_tcache_gc_interval_ms; test/unit/stats passes (8/10 pass, 2 skip, 0 fail).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for making tcache GC interval configurable. This needed for profiling tools that considerably slow down the workload (20x or more) resulting in the GC running 20x more frequently under profiling than the rest of the workload.
Set it in milliseconds at startup with MALLOC_CONF=tcache_gc_interval_ms:N (default 10), or adjust it at run time by writing tcache.gc_interval_ms via mallctl.
Tests: