mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: block: Reduce latency in completion handling
Signal the guest before processing queue submissions to enable earlier guest side completion event handling, reducing end-to-end latency for block device operations. FIO benchmarks show up to 7.4% bandwidth improvement at 16 iodepth and 4k block size with NVMe devices. Signed-off-by: wuxinyue <wuxinyue.wxy@antgroup.com>
This commit is contained in:
@@ -607,17 +607,14 @@ impl EpollHelperHandler for BlockEpollHandler {
|
||||
))
|
||||
})?;
|
||||
|
||||
self.try_signal_used_queue()?;
|
||||
|
||||
let rate_limit_reached = self.rate_limiter.as_ref().is_some_and(|r| r.is_blocked());
|
||||
|
||||
// Process the queue only when the rate limit is not reached
|
||||
if !rate_limit_reached {
|
||||
self.process_queue_submit().map_err(|e| {
|
||||
EpollHelperError::HandleEvent(anyhow!(
|
||||
"Failed to process queue (submit): {e:?}"
|
||||
))
|
||||
})?;
|
||||
self.process_queue_submit_and_signal()?;
|
||||
}
|
||||
self.try_signal_used_queue()?;
|
||||
}
|
||||
RATE_LIMITER_EVENT => {
|
||||
if let Some(rate_limiter) = &mut self.rate_limiter {
|
||||
|
||||
Reference in New Issue
Block a user