cloud-hypervisor/hypervisor/src
Rob Bradford 0fec326582 hypervisor, vmm: Remove shared ownership of VmmOps
This interface is used by the vCPU thread to delegate responsibility for
handling MMIO/PIO operations and to support different approaches than a
VM exit.

During profiling I found that we were spending 13.75% of the boot CPU
uage acquiring access to the object holding the VmmOps via
ArcSwap::load_full()

    13.75%     6.02%  vcpu0            cloud-hypervisor    [.] arc_swap::ArcSwapAny<T,S>::load_full
            |
            ---arc_swap::ArcSwapAny<T,S>::load_full
               |
                --13.43%--<hypervisor::kvm::KvmVcpu as hypervisor::cpu::Vcpu>::run
                          std::sys_common::backtrace::__rust_begin_short_backtrace
                          core::ops::function::FnOnce::call_once{{vtable-shim}}
                          std::sys::unix:🧵:Thread:🆕:thread_start

However since the object implementing VmmOps does not need to be mutable
and it is only used from the vCPU side we can change the ownership to
being a simple Arc<> that is passed in when calling create_vcpu().

This completely removes the above CPU usage from subsequent profiles.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2020-11-19 00:16:02 +01:00
..
arch vmm: hypervisor: fix white space issues 2020-06-29 21:51:59 +01:00
kvm hypervisor, vmm: Remove shared ownership of VmmOps 2020-11-19 00:16:02 +01:00
cpu.rs vmm: Implement VM rebooting on AArch64 2020-10-30 17:14:44 +00:00
device.rs hypervisor: Implement get_device_attr method for AArch64 2020-09-23 12:37:25 +01:00
hypervisor.rs hypervisor: drop get_api_version from Hypervisor trait 2020-09-07 11:59:08 +01:00
lib.rs AArch64: Implement AArch64 vCPU states save/restore 2020-09-23 12:37:25 +01:00
vm.rs hypervisor, vmm: Remove shared ownership of VmmOps 2020-11-19 00:16:02 +01:00