virtio-devices: virtio-blk always tries signal used queue when receiving completion event#6672
Merged
rbradford merged 1 commit intocloud-hypervisor:mainfrom Aug 31, 2024
Conversation
6d13850 to
d9ae1ae
Compare
When the rate limit was reached it was possible for the notification to the guest to be lost since the logic to handle the notification was tightly coupled with processing the queue. The notification would eventually be triggered when the rate limit pool was refilled but this could add significant latency. Address this by refactoring the code to separate processing queue and signalling - the processing of the queue is suspended when the rate limit is reached but the signalling will still be attempted if needed (i.e. VIRTIO_F_EVENT_IDX is still considered.) Signed-off-by: wuxinyue <wuxinyue.wxy@antgroup.com> Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
d9ae1ae to
ea96bac
Compare
rbradford
reviewed
Aug 23, 2024
Member
rbradford
left a comment
There was a problem hiding this comment.
I made a change to your commit message (no code change) to reflect what was written in the PR body and to match the project style. Hopefully this works for you?
Author
|
@rbradford yes, quite clear. thx. |
liuw
approved these changes
Aug 30, 2024
rbradford
approved these changes
Aug 31, 2024
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.
Currently, when finishing processing disk IO completion event, virtio-blk calls
process_queue_submit_and_signalif rate limit not reached. That's because to support notification suppression, the backend needs to work in a loop and process all available event in the queue until nothing remained.However, for case that
rate_limit_reached == true, the backend stop handling without sending frontend a signal. Though when rate limit refills, the backend will be able to send the signal when handlingRATE_LIMITER_EVENT, the signal is actually delayed for some time.This fix will make the backend able to send the signal immediately no matter rate limit is hit or not.