-
Notifications
You must be signed in to change notification settings - Fork 172
rework slab profile setup #59
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
rework slab profile setup #59
Conversation
ping, want to get this merged to start canarying |
return CC_ERROR; | ||
} | ||
|
||
nbyte = SLAB_ALIGN_DOWN(max_chunk_size, CC_ALIGNMENT); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Yeah, the problem with the unit test failing results from starting at the min. This is because if we start at the min and grow upwards, we cannot guarantee the largest size will fit "snugly" given the slab size; in the original implementation the largest item size was just over 500 KB with just one item per slab despite the slab size being 1 MB
As discussed with @thinkingfish in the meeting on Monday, we are moving to a hybrid linear/exponential growth scheme to give us the best of both worlds between adhering to min_chunk_size, max_chunk_size, and minimizing internal fragmentation. See the comments in the code for an explanation of the scheme. I've tested this manually by changing min/max chunk size and growth factor and it seems to work. it also passes all of the unit tests we have written for slab. |
@@ -266,10 +323,25 @@ _slab_profile_setup(char *setup_profile, char *setup_profile_factor) | |||
|
|||
profile[i++] = nbyte; | |||
nitem = slab_capacity() / nbyte / growth_factor; | |||
if (nitem > 0) { | |||
if (nitem > linear_nitem) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
ah, right. had a brain fart while restructuring my loops. thanks!
This comment was marked as spam.
This comment was marked as spam.
…-pmem-mapping-addresses Changing mapping addresses for pmem datapools
add metric_print - will be used in stats implementation
previously, slab was failing one of the unit tests for allocating large items. this is because the slab profile was not being generated ideally; the largest slab profile for slab size of 1 MB was a little over 500 KB, such that the profile entry was too large to fit 2 items but wasted nearly 500 KB of space. this PR addresses this by starting with the max chunk size and moving down when generating a slab profile.