-
Notifications
You must be signed in to change notification settings - Fork 13
Simplify CacheAllocatorConfig implementation for memory tiers #13
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
Conversation
It's implementation is mostly based on PosixShmSegment. Also, extend ShmManager and ShmSegmentOpts to support this new segment type.
After introducing file segment type, nameToKey_ does not provide enough information to recover/remove segments on restart. This commit fixes that by replacing nameToKey_ with nameToOpts_. Previously, the Key from nameToKey_ map was only used in a single DCHECK().
* New class MemoryTierCacheConfig allows to configure a memory tier. Setting tier size and location of a file for file-backed memory are supported in this initial implementation; * New member, vector of memory tiers, is added to class CacheAllocatorConfig. * New test suite, chelib/allocator/tests/MemoryTiersTest.cpp, demonstrates the usage of and tests extended config API.
Run centos and debian workflows on push and PR
Publish changes from innersouce
to allow using new configureMemoryTiers() API with legacy behavior. Move validation code for memory tiers to validate() method and convert ratios to sizes lazily (on get)..
It wrongly assumed that the only possible segment type is PosixSysV segment.
Config api integration
Run tests on CI
FBSW-208 Moved common segment code for posix and file shm segments into ShmCommon
Run long tests (navy/bench) every day on CI
Honestly, I like this version better because it seems cleaner and safer. I do agree that dealing with cache-global settings is the problem here. What could we do instead of propagating every global setting to every tier? Would it make more sense to create a kind of property container for cache-wide settings which tiers could reference? |
24f0bc2
to
a2834af
Compare
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.
Right, this might be one possible approach - but I'm not sure if we should do this now. If you like this solution then I'm OK with merging it as soon as tests will pass.
Reviewable status: 0 of 2 files reviewed, all discussions resolved
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @igchor)
Revert some of the changes made earlier and reimplement them without chaning getMemoryTierConfigs(). After this change, it is no longer possible to call setCacheSize() and configureMemoryTiers() in arbitrary order - setCacheSize() must be called first.
Initial support of NUMA bindings
Initial support of NUMA bindings
Revert some of the changes made earlier and reimplement them without
chaning getMemoryTierConfigs().
After this change, it is no longer possible to call setCacheSize()
and configureMemoryTiers() in arbitrary order - setCacheSize() must
be called first.
I'm not 100% sure if this way is better because if we introduce some new global setting which we would like to apply for all tiers (like currently usePosixShm) we will have to do that both in configureMemoryTiers and in function setting this property (see usePosixShm for example). Currently, we can do that just once, in getMemoryTierConfigs()
This change is