Kernel as hypervisor: Andrea Arcangeli

A Linux kernel developer explains the key overlaps between the hypervisor and the OS kernel. The KVM architecture uses Linux as both, which puts new capabilities at the hypervisor's disposal.

You're now with Qumranet which is the company behind KVM. Can you briefly tell me about the design of KVM and how that differs from previous virtualization approaches such as Xen and VMware?

I really like this approach because when you start doing really advanced virtualizations features like swapping the guest memory and swapping different parts of the address space you start using the same algorithms that the normal Linux kernel is using for swapping normal processes and this avoids duplication of algorithms, and when the kernel is optimized to do better swapping the virtual machine gets the same benefits.

You have Linux itself taking on the role of the hypervisor, so you don't have a hypervisor and then a different OS running as the guest. So Linux is the lowest level OS on the machine.

Exactly. It's especially useful with features like shared memory between guests or ballooning, and when you want to have guarantees that a certain number of virtual machines won't run the hypervisor out of memory. You can just start a lot of swap and share the memory and balloon with the guest and everything works very nicely.

Or you can guarantee a certain virtual machine to get more RAM, when you want to prioritize different guests to have more memory or less memory. So having the kernel algorithms doing both these operations really is clean and efficient.

And features like, say, power management you would have to implement those for Linux anyway and so you end up with power management at the kernel level already working rather than having to do it in the hypervisor too?

Yes the same exact advantage you get for virtual memory, you get for power management. Like you said the Linux kernel already has many power management features so you don't have to write all those things in the hypervisor.

So the more you grow into advanced virtualization the more the design pays off and the more the hypervisor will start to look like a real operating system, full-blown with all the drivers and knowledge about hardware, and not any more just a little hypervisor doing all the memory management for the virtualization.

Join the newsletter!

Error: Please check your email address.

More about KVMLinuxMicrosoftNICEVMware Australia

Show Comments

Market Place

[]