Skip to content

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

Closed
wants to merge 19 commits into from

Conversation

igchor
Copy link

@igchor igchor commented Nov 22, 2021

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 Reviewable

igchor and others added 18 commits November 2, 2021 16:00
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.
FBSW-208 Moved common segment code for posix and file shm segments into ShmCommon
Run long tests (navy/bench) every day on CI
@victoria-mcgrath
Copy link
Collaborator

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?

@igchor igchor force-pushed the config_api_simplify branch from 24f0bc2 to a2834af Compare November 23, 2021 15:52
Copy link
Author

@igchor igchor left a 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

Copy link
Collaborator

@victoria-mcgrath victoria-mcgrath left a 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: :shipit: 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.
@igchor igchor marked this pull request as ready for review November 24, 2021 08:15
@igchor igchor closed this Jun 10, 2022
vinser52 added a commit to vinser52/CacheLib that referenced this pull request Sep 13, 2022
Initial support of NUMA bindings
danielobiri pushed a commit to danielobiri/CacheLib that referenced this pull request Oct 20, 2022
Initial support of NUMA bindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants