Always cancel read cell on write path#275
Merged
akiradeveloper merged 1 commit intomasterfrom Jul 10, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the write path logic to always cancel read cache cells, regardless of whether a write operation results in a cache hit or miss. Previously, the might_cancel_read_cache_cell() function was only called when the cache lookup resulted in a miss (else clause), but now it executes unconditionally after cache lookup operations.
- Removes conditional execution of read cache cell cancellation in write operations
- Applies the change to both
do_process_writeandprocess_write_wafunctions - Simplifies the logic by making read cache cancellation consistent across all write scenarios
Comment on lines
1181
to
1182
|
|
||
| cache_lookup(wb, bio, &res); |
There was a problem hiding this comment.
[nitpick] There appears to be an unnecessary blank line removal after cache_lookup. This formatting change is unrelated to the core logic change and could be kept for better code readability.
Suggested change
| cache_lookup(wb, bio, &res); | |
| cache_lookup(wb, bio, &res); |
Cancelling possible read cache on only write-miss may be okay but it is very difficult for me to reason the correctness. Always cancelling doesn't harm the performance so much because write-hit is not often and the lookup overhead is small enough. For these reasons, I do this change. Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
f9b4b8a to
eb17f8d
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.
Cancelling possible read cache on only write-miss may be okay but it is very difficult for me to reason the correctness.
Always cancelling doesn't harm the performance so much because write-hit is not often and the lookup overhead is small enough.
For these reasons, I do this change.