Repository navigation
SLRU byte counts and names, W-TinyLFU admission - #5
Merged
Merged
Conversation
marcft
force-pushed
the
fix/slru-review-387
branch
from
November 13, 2026 22:32
288fb6c to
08277a7
Compare
SLRU_cool() moved obj_size between segments while promote, insert and evict moved obj_size + obj_md_size, so with --consider-obj-metadata each promote-then-demote left the metadata on the upper segment's count. When no segment had room, SLRU_insert() evicted until the whole cache fit, which could push the lowest segment past its share when objects differ in size; it now evicts until that segment fits too. The cache name and -e print now show the shares asked for (seg_ratio) instead of the byte limits, so seg-size=1:1 is S2LRU(50:50) at every cache size and seg-size=1:2:3:4 prints 10:20:30:40. Count mode (--ignore-obj-size=1) is unchanged.
marcft
force-pushed
the
fix/slru-review-387
branch
from
November 13, 2026 22:46
08277a7 to
fd4271d
Compare
In byte mode the main cache evicts whole objects, so it can sit a little below its size. A window victim that fit that space was admitted without the frequency check, even long after the main cache had filled. Remember that the main cache has filled, and compare from then on; the hill climber clears this when it grows the main cache. A winning window victim larger than the main victim now evicts until it fits. Two tests push a cold object out of the window into a full main cache with free space: from SLRU segments that did not add up (count mode; fails on develop 4e3521a) and from evicting whole objects (byte mode; fails without this fix). Count mode (--ignore-obj-size=1) is unchanged.
marcft
force-pushed
the
fix/slru-review-387
branch
from
November 13, 2026 22:56
fd4271d to
dcf8763
Compare
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.
Changes for the review on the upstream PR, in two commits on top of
fix/slru-seg-size-remainder.fix(SLRU): exact segment byte counts and stable names: review points 2 and 4 (metadata bytes lost when demoting; probation overfilled in byte mode; names now from the shares asked for).fix(WTinyLFU): compare every admission once the main cache is full: review point 1, plus the W-TinyLFU tests for point 5.Checks
--ignore-obj-size=1) is bit-identical to2a04d238on 8 configs (SLRU and W-TinyLFU, fixed and hill climber,cloudPhysicsIO.vscsiand cluster26).data/sample (smoke test only): W-TinyLFU 1 GB 0.4705 -> 0.4761;test_SLRUexpected byte-mode misses updated.4e3521a9; the byte-mode test fails without commit 2.test_cli.sh429 passed / 0 failed, no warnings, clang-format clean.Open choice
Comparing every admission once main is full is stricter than Caffeine, which lets a candidate into free space without a check.