mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
device_manager: Avoid checking io_uring support when it's not needed
After testing, io_uring_is_supported() causes about 38ms of overhead when creating virtio-blk. By modifying the position of io_uring_is_supported(), the overhead of creating virtio-blk is reduced to less than 1ms when we close io_uring. Signed-off-by: Jinrong Liang <cloudliang@tencent.com>
This commit is contained in:
parent
bc310bb173
commit
cb171d4a23
@ -2100,7 +2100,7 @@ impl DeviceManager {
|
||||
ImageType::FixedVhd => {
|
||||
// Use asynchronous backend relying on io_uring if the
|
||||
// syscalls are supported.
|
||||
if self.io_uring_is_supported() && !disk_cfg.disable_io_uring {
|
||||
if !disk_cfg.disable_io_uring && self.io_uring_is_supported() {
|
||||
info!("Using asynchronous fixed VHD disk file (io_uring)");
|
||||
Box::new(
|
||||
FixedVhdDiskAsync::new(file)
|
||||
@ -2117,7 +2117,7 @@ impl DeviceManager {
|
||||
ImageType::Raw => {
|
||||
// Use asynchronous backend relying on io_uring if the
|
||||
// syscalls are supported.
|
||||
if self.io_uring_is_supported() && !disk_cfg.disable_io_uring {
|
||||
if !disk_cfg.disable_io_uring && self.io_uring_is_supported() {
|
||||
info!("Using asynchronous RAW disk file (io_uring)");
|
||||
Box::new(RawFileDisk::new(file)) as Box<dyn DiskFile>
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user