mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +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:
@@ -2100,7 +2100,7 @@ impl DeviceManager {
|
|||||||
ImageType::FixedVhd => {
|
ImageType::FixedVhd => {
|
||||||
// Use asynchronous backend relying on io_uring if the
|
// Use asynchronous backend relying on io_uring if the
|
||||||
// syscalls are supported.
|
// 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)");
|
info!("Using asynchronous fixed VHD disk file (io_uring)");
|
||||||
Box::new(
|
Box::new(
|
||||||
FixedVhdDiskAsync::new(file)
|
FixedVhdDiskAsync::new(file)
|
||||||
@@ -2117,7 +2117,7 @@ impl DeviceManager {
|
|||||||
ImageType::Raw => {
|
ImageType::Raw => {
|
||||||
// Use asynchronous backend relying on io_uring if the
|
// Use asynchronous backend relying on io_uring if the
|
||||||
// syscalls are supported.
|
// 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)");
|
info!("Using asynchronous RAW disk file (io_uring)");
|
||||||
Box::new(RawFileDisk::new(file)) as Box<dyn DiskFile>
|
Box::new(RawFileDisk::new(file)) as Box<dyn DiskFile>
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user