cloud-hypervisor/vmm/src
Rob Bradford 0faa7afac2 vmm: Add fast path for PCI config IO port
Looking up devices on the port I/O bus is time consuming during the
boot at there is an O(lg n) tree lookup and the overhead from taking a
lock on the bus contents.

Avoid this by adding a fast path uses the hardcoded port address and
size and directs PCI config requests directly to the device.

Command line:
target/release/cloud-hypervisor --kernel ~/src/linux/vmlinux --cmdline "root=/dev/vda1 console=ttyS0" --serial tty --console off --disk path=~/workloads/focal-server-cloudimg-amd64-custom-20210609-0.raw --api-socket /tmp/api

PIO exit: 17913
PCI fast path: 17871
Percentage on fast path: 99.8%

perf before:

marvin:~/src/cloud-hypervisor (main *)$ perf report -g | grep resolve
     6.20%     6.20%  vcpu0            cloud-hypervisor    [.] vm_device:🚌:Bus::resolve

perf after:

marvin:~/src/cloud-hypervisor (2021-09-17-ioapic-fast-path *)$ perf report -g | grep resolve
     0.08%     0.08%  vcpu0            cloud-hypervisor    [.] vm_device:🚌:Bus::resolve

The compromise required to implement this fast path is bringing the
creation of the PciConfigIo device into the DeviceManager::new() so that
it can be used in the VmmOps struct which is created before
DeviceManager::create_devices() is called.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-09-17 17:09:45 +01:00
..
api vmm: Shutdown VMM if API thread panics 2021-09-10 10:52:08 -07:00
acpi.rs vmm: Move NUMA node data structures to arch 2021-08-12 10:49:02 +02:00
clone3.rs vmm: notify virtio-console of pty resizes 2021-09-14 15:43:25 +01:00
config.rs vmm: Remove concept of "input_enabled" 2021-09-08 11:26:48 -07:00
cpu.rs vmm: cpu: Increase robustness of CpuManager control device 2021-09-10 10:22:05 -07:00
device_manager.rs vmm: Add fast path for PCI config IO port 2021-09-17 17:09:45 +01:00
device_tree.rs vmm: device_manager: Use DeviceTree to store PCI devices 2021-03-18 15:26:25 +01:00
interrupt.rs clippy: Fix redundant allocations 2021-07-29 13:28:57 +02:00
lib.rs vmm: Switch to using the serial_manager for serial input 2021-09-17 11:15:35 +01:00
memory_manager.rs vmm: memory_manager: Increase robustness of MemoryManager control device 2021-09-10 10:23:19 -07:00
migration.rs vmm: Simplify snapshot/restore path handling 2021-03-12 13:03:01 +01:00
seccomp_filters.rs vmm: notify virtio-console of pty resizes 2021-09-14 15:43:25 +01:00
serial_buffer.rs vmm: Introduce a SerialBuffer for buffering serial output 2021-09-02 13:52:18 +01:00
serial_manager.rs vmm: Add new serial_manager for serial input handling 2021-09-17 11:15:35 +01:00
sigwinch_listener.rs vmm: notify virtio-console of pty resizes 2021-09-14 15:43:25 +01:00
vm.rs vmm: Add fast path for PCI config IO port 2021-09-17 17:09:45 +01:00