Repository navigation
Add a knob to yield between Redwood lazy clear pages - #14609
Open
jmslocum16 wants to merge 6 commits into
Open
jmslocum16 wants to merge 6 commits into
jmslocum16 wants to merge 6 commits into
Conversation
saintstack
approved these changes
Nov 20, 2026
saintstack
enabled auto-merge (squash)
November 20, 2026 17:32
This branch has not been deployed
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.
Redwood's lazy clear frees a cleared range in the background by reading internal pages and freeing or requeueing their children. Each batch of
REDWOOD_LAZY_CLEAR_BATCH_SIZE_PAGESpages, with the hundreds of children of each, runs without yielding, so a large clear produces a burst of long tasks that delay reads. This addsREDWOOD_LAZY_CLEAR_YIELD_INTERVAL, which yields after that many processed pages at the priority the lazy clear started with. It defaults to 0 (never yield, the current behavior) and is randomized in simulation.Results
The storage engine benchmark suite from #14603, on
ssd-redwood-1, comparing this change withREDWOOD_LAZY_CLEAR_YIELD_INTERVAL=1against the same base without it. Each configuration ran once on c5d.12xlarge hosts, with the storage server pinned to one core and a cache of 10% of the dataset, otherwise with default knobs. In the large clear test, the workload runs at 4000 tps with 32 client threads while a full-size second 100GB dataset is cleared at t=150s and lazily reclaimed.Yielding every page cuts the p50 spike during the clear by 30-40% without slowing reclaim. The p99 in this test is dominated by long storage server commit tasks, which the commit path yielding change in #14608 addresses separately. Outside the clear, latency and throughput are unchanged, as expected for a knob that only acts during lazy clear.