1

When using a virtual machine, one of the key performance parameters is 'VM exits'. I have a multicore VM under VM VirtualBox, indicating on average 30k VM exits per second, but I have nothing to compare this value to, whether high or completely reasonable.

How does one evaluate this parameter and its performance impact?

1 Answer 1

1

From VirtualBox 3.6. Details About Hardware Virtualization:

With Intel VT-x, there are two distinct modes of CPU operation: VMX root mode and non-root mode.

  • In root mode, the CPU operates much like older generations of processors without VT-x support. There are four privilege levels, called rings, and the same instruction set is supported, with the addition of several virtualization specific instruction. Root mode is what a host operating system without virtualization uses, and it is also used by a hypervisor when virtualization is active.

  • In non-root mode, CPU operation is significantly different. There are still four privilege rings and the same instruction set, but a new structure called VMCS (Virtual Machine Control Structure) now controls the CPU operation and determines how certain instructions behave. Non-root mode is where guest systems run.

Switching from root mode to non-root mode is called "VM entry", the switch back is "VM exit". The VMCS includes a guest and host state area which is saved/restored at VM entry and exit. Most importantly, the VMCS controls which guest operations will cause VM exits.

This means that control is switched between guest and host. Most likely this is because of the guest accessing host resources such as the disk.

VM products usually implement virtual cores as threads or processes on the host, so switching between virtual cores involves switching execution between host threads/processes. This will also require host API, so more control switches.

Control switches are a relatively slow operation, but they are also very dependent upon the hardware and the software in action. Their performance cannot be compared except to an identical or similar environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .