mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block_util: Avoid intermediate completion queue allocation
Rather than aggregate the completion list into an intermediate vector
instead adjust the API to provide one completion item at a time.
With DHAT this shows the number of heap allocations has decreased.
Before:
dhat: Total: 623,852 bytes in 8,157 blocks
After:
dhat: Total: 380,444 bytes in 3,469 blocks
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -244,8 +244,7 @@ impl BlockEpollHandler {
|
||||
let mut read_ops = Wrapping(0);
|
||||
let mut write_ops = Wrapping(0);
|
||||
|
||||
let completion_list = self.disk_image.complete();
|
||||
for (user_data, result) in completion_list {
|
||||
while let Some((user_data, result)) = self.disk_image.next_completed_request() {
|
||||
let desc_index = user_data as u16;
|
||||
|
||||
let mut request = self.find_inflight_request(desc_index)?;
|
||||
|
||||
Reference in New Issue
Block a user