Skip to content

Adding lockMemory flag support to the cachebench #81

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

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cachelib/cachebench/cache/Cache-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Cache<Allocator>::Cache(const CacheConfig& config,
allocatorConfig_.usePosixForShm();
}

allocatorConfig_.setMemoryLocking(config_.lockMemory);

if (!config_.memoryTierConfigs.empty()) {
allocatorConfig_.configureMemoryTiers(config_.memoryTierConfigs);
}
Expand Down
1 change: 1 addition & 0 deletions cachelib/cachebench/util/CacheConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ CacheConfig::CacheConfig(const folly::dynamic& configJson) {
JSONSetVal(configJson, memoryOnlyTTL);

JSONSetVal(configJson, usePosixShm);
JSONSetVal(configJson, lockMemory);
if (configJson.count("memoryTiers")) {
for (auto& it : configJson["memoryTiers"]) {
memoryTierConfigs.push_back(
Expand Down
3 changes: 3 additions & 0 deletions cachelib/cachebench/util/CacheConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ struct CacheConfig : public JSONConfig {
// Use Posix Shm instead of SysVShm
bool usePosixShm{false};

// Lock memory in the RAM
bool lockMemory{false};

// Memory tiers configs
std::vector<MemoryTierCacheConfig> memoryTierConfigs{};

Expand Down