Repository navigation
Add Merlin eviction algorithm and fix capacity remainders in SR-LRU and SLRU - #343
Merged
Merged
Conversation
- Add Merlin eviction algorithm in cpp/merlin.cpp. The details of this algorithm are in [MerlinOSDI26AE](https://github.com/TELOS-syslab/MerlinOSDI26AE). - Add merlin_init declaration to evictionAlgo.h - Add merlin's metadata object information in cacheObj.h - Register an entry for Merlin in cacheAlgoRegistry.c - Add cpp/merlin.cpp to CMakeLists.txt build
SR-LRU initialized both resident queues to floor(cache_size / 2), so Cacheus and standalone SR-LRU lost one byte for odd capacities. Allocate SR first and give R the remaining capacity using integer subtraction. This preserves the requested resident budget without floating-point rounding, including capacities above 2^53. SLRU and SLRUv0 similarly truncated each equally sized segment. Assign remainder bytes to the upper segments so their total matches the cache capacity and objects admitted into lower segments fit after promotion. Explicit SLRU segment weights and capacities divisible by the segment count retain their existing layouts.
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add the Merlin eviction algorithm, based on MerlinOSDI26AE. Merlin combines filter, staging, and core FIFO queues with ghost history and a counting Bloom filter to guide admission and promotion. This change integrates Merlin into the build, algorithm registry, CLI, and cache object metadata.
Fix capacity splitting in SR-LRU, which Cacheus also uses, and in SLRU and SLRUv0. SR-LRU previously assigned
floor(cache_size / 2)to both resident queues: a capacity of 101 therefore produced a total budget of 100. It now assigns the remainder to the second queue. SLRU and SLRUv0 distribute remainder bytes to the upper segments so that segment budgets sum to the requested capacity. Explicit SLRU segment weights retain their existing behavior.The changes are separated into two commits:
feat: Add Merlin algofix: preserve capacity remainders in SR-LRU and SLRUType of change
How was it tested?
cd _build && ./bin/cachesim ../data/cloudPhysicsIO.vscsi vscsi merlin 1mb
ctest --test-dir _build --output-on-failurepasses-Wall -Wextra -Werror)Checklist
clang-format(or the pre-commit hook fromscripts/setup_hooks.sh)