Fix 1) Safe GC RU handling (ru->ruh based ptr) 2) Cost-benefit correc…#187
Merged
Conversation
…t logic and queing + testing
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.
Fix unsafe GC RU access (ruh-based lookup) and correct Cost-Benefit GC scoring/queueing
Description
Summary
Two independent bugs in
hw/femu/bbssd/ftl.caffecting garbage collectioncorrectness on the FDP SSD FTL. This PR makes RU lookup safe by routing through
the owning RUH, and corrects the Cost-Benefit (CB) policy's victim selection
and queueing logic. Verified with fio random/sequential write workloads under
both Greedy and Cost-Benefit GC.
(1 file changed, +201 / -189)
Problem
Unsafe Reclaim Unit (RU) handling during GC
The previous GC path dereferenced RU pointers without going through the
owning Reclaim Unit Handle (RUH). This was fragile because "RU pointer could be stale
during GC process, clean_one_block_fdp_style(.., new_ru<-this), leading to GC operating on the wrong RU" / "a NULL
Solution
ru->ruhpointer.
Testing
Tested Greedy and Cost-Benefit GC together with fio random-write and
sequential-write workloads across multiple runs. No crashes or invalid RU
accesses observed; Cost-Benefit now produces the expected victim
distribution and lower WAF than Greedy on the random-write workload.
Files
hw/femu/bbssd/ftl.c(+201 / -189)Type of Change
Testing
FEMU Modes Tested
Platform Testing
Checklist
Related Issues
Fixes #186
Additional Notes
fio