-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce FORCE_DEFRAG compilation option to allow activedefrag run when allocator is not jemalloc #1303
base: unstable
Are you sure you want to change the base?
Conversation
Introduce compile time option to force activedefrag to run even when jemalloc is not used as the allocator. This is in order to be able to run tests with defrag enabled while using memory instrumantation tools. Signed-off-by: ranshid <[email protected]>
Introduce compile time option to force activedefrag to run even when jemalloc is not used as the allocator. This is in order to be able to run tests with defrag enabled while using memory instrumantation tools. Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1303 +/- ##
============================================
+ Coverage 70.71% 70.87% +0.15%
============================================
Files 119 119
Lines 64652 64616 -36
============================================
+ Hits 45717 45794 +77
+ Misses 18935 18822 -113
|
Signed-off-by: Ran Shidlansik <[email protected]>
I think we'll want to merge this PR first btw, #1242, since it already exists. I think there will be some merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly makes sense to me. Some ideas for clarity but nothing to really change the direction.
src/defrag.c
Outdated
@@ -755,6 +755,15 @@ void defragScanCallback(void *privdata, const dictEntry *de) { | |||
* or not, a false detection can cause the defragmenter to waste a lot of CPU | |||
* without the possibility of getting any results. */ | |||
float getAllocatorFragmentation(size_t *out_frag_bytes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of feels like you should override computeDefragCycles instead, and have that should always set active_defrag_running
to like 100%.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with it (makes sense) I do not, however want to break tests which are checking the active_defrag_running, so maybe I can just use the active-defrag-cycle-max as the return value?
Alternatively we can have a tag to skip tests in case of DEBUG_FORCE_DEFRAG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we can have a tag to skip tests in case of DEBUG_FORCE_DEFRAG
This intuitively makes a bit more sense to me, since defrag shouldn't really work correctly since we are completely breaking defrag here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the tests already are checking for jemalloc memory to enable the defragmentation, so I think that the tests should all still be skipped anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my last change keeps the same logic and the code is cleaner. I find having the defrag reporting the fragmentation based on the config limits is fine but take a look and let me know.
@ranshid Zvis change is now merged. Jim's is basically also ready to go so you should be able to resume updating this if you want. |
Thank you. just got time to circle back on this one. merging and continue where I left off |
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
we will probably hit issues from day 1. eg:
I think it is after the changes introduced in #1242 since the db expires can be freed in the background but is passed as target in beginDefragCycle. I wonder if to invest time to fix it now or address them later |
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Madelyn Olson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direction looks fine to me, but just a minor comment about removing one of the test permutations.
Signed-off-by: Madelyn Olson <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]> Signed-off-by: ranshid <[email protected]>
…ests Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Introduce compile time option to force activedefrag to run even when
jemalloc is not used as the allocator.
This is in order to be able to run tests with defrag enabled
while using memory instrumentation tools.
fixes: #1241