Skip to content
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

Add Sieve implementation and Integrate Sieve into Cachebench #336

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions cachelib/allocator/CacheAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ template class CacheAllocator<LruCacheTrait>;
template class CacheAllocator<LruCacheWithSpinBucketsTrait>;
template class CacheAllocator<Lru2QCacheTrait>;
template class CacheAllocator<TinyLFUCacheTrait>;
template class CacheAllocator<SieveCacheTrait>;
} // namespace facebook::cachelib
8 changes: 8 additions & 0 deletions cachelib/allocator/CacheAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5980,4 +5980,12 @@ using Lru2QAllocator = CacheAllocator<Lru2QCacheTrait>;
// inserted items. And eventually it will onl admit items that are accessed
// beyond a threshold into the warm cache.
using TinyLFUAllocator = CacheAllocator<TinyLFUCacheTrait>;


// CacheAllocator with Sieve eviction policy
// It uses the access bit keep track of item's popularity
// During eviction, the hand ptr sweeps backward to find itme with access bit turned off,
// and turns off access bit as it goes.
using SieveAllocator = CacheAllocator<SieveCacheTrait>;

} // namespace facebook::cachelib
6 changes: 6 additions & 0 deletions cachelib/allocator/CacheTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,11 @@ struct TinyLFUCacheTrait {
using AccessTypeLocks = SharedMutexBuckets;
};

struct SieveCacheTrait {
using MMType = MMSieve;
using AccessType = ChainedHashTable;
using AccessTypeLocks = SharedMutexBuckets;
};

} // namespace cachelib
} // namespace facebook
Loading
Loading