Skip to content

SLRU byte counts and names, W-TinyLFU admission - #5

Merged
marcft merged 2 commits into
fix/slru-seg-size-remainderfrom
fix/slru-review-387
Nov 13, 2026
Merged

marcft merged 2 commits into
fix/slru-seg-size-remainderfrom
fix/slru-review-387

Conversation

@marcft

@marcft marcft commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Changes for the review on the upstream PR, in two commits on top of fix/slru-seg-size-remainder.

  1. 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).
  2. fix(WTinyLFU): compare every admission once the main cache is full: review point 1, plus the W-TinyLFU tests for point 5.

Checks

  • Count mode (--ignore-obj-size=1) is bit-identical to 2a04d238 on 8 configs (SLRU and W-TinyLFU, fixed and hill climber, cloudPhysicsIO.vscsi and cluster26).
  • Byte mode moves. On the data/ sample (smoke test only): W-TinyLFU 1 GB 0.4705 -> 0.4761; test_SLRU expected byte-mode misses updated.
  • The count-mode test fails on develop 4e3521a9; the byte-mode test fails without commit 2.
  • Each commit: ctest 16/16, test_cli.sh 429 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.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 22:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@marcft
marcft force-pushed the fix/slru-review-387 branch from 288fb6c to 08277a7 Compare November 13, 2026 22:32
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
marcft force-pushed the fix/slru-review-387 branch from 08277a7 to fd4271d Compare November 13, 2026 22:46
@marcft marcft changed the title Review changes for #387 (SLRU byte mode, W-TinyLFU admission, labels, tests) Review changes for #387 (SLRU byte counts and names, W-TinyLFU admission) Nov 13, 2026
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
marcft force-pushed the fix/slru-review-387 branch from fd4271d to dcf8763 Compare November 13, 2026 22:56
@marcft
marcft merged commit dcf8763 into fix/slru-seg-size-remainder Nov 13, 2026
@marcft marcft changed the title Review changes for #387 (SLRU byte counts and names, W-TinyLFU admission) SLRU byte counts and names, W-TinyLFU admission Nov 13, 2026
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.

2 participants