I am studying Virtualization. And the very first thing i got stuck on, is Virtual Machine Monitor Overhead. I read somewhere: Why not to virtualise - Virtualization Overhead. And that it is most of the times less than 5%. But basically I want to understand is What exactly is this Overhead? Any proper definition? I googled but did not find satisfying answer. Any one know about it?
A typical OS is divided into the kernel and userspace. The kernel has direct access to hardware, the userspace (where programs run) does not, and must go through the kernel. Each program runs "within" a userspace provided by the kernel. (Modern CPUs have an MMU that physically prevents userspaces from doing things the kernel does not allow.)
It would be faster if userspace could access hardware directly, instead of going through the kernel, but significantly less safer. So an OS introduces some overhead.
Virtual machines extend this concept one step further. OSes, including the kernel and its userspace, run "within" a virtual machine monitor (VMM) - also known as a hypervisor. Only the hypervisor has actual direct access to the hardware, and the kernel (inside the VM i.e. Guest OS's kernel) must "go through" the hypervisor for hardware access. Typically the way VMs are set up, the kernel doesn't even know it's running on a VM. However, because the kernel has to go through another layer to get to hardware (even though it doesn't know it), it's a bit slower. This is VMM overhead.
Newer CPUs support VMs in hardware, and also support "remapping" hardware within VMs (IOMMU), so the overhead is usually very small.