[Gllug] performance of xen dom0 vs native linux

Richard Jones rich at annexia.org
Fri May 8 22:30:01 UTC 2009


On Fri, May 08, 2009 at 10:59:37PM +0100, Nahuel Marisi wrote:
> I haven't actually played around with KVM yet (it's next on the list).
> However, isn't KVM slower than Xen since it has to emulate
> most of the hardware (ie, hardrive controller, graphics card, etc) through
> the use of qemu? As oppose to Xen which has direct access to it, and uses
> dom0 kernel modules?

KVM depends on a couple of factors to make it fast: Firstly you need
to have hardware support in your processor, Intel VT or AMD-V,
summarised here:

https://secure.wikimedia.org/wikipedia/en/wiki/X86_virtualization#Hardware_support

There are several levels of hardware assistance available.  Newer
Intel parts support a second-gen hardware VT called EPT, which
provides better performance.

The second factor is to install virtio drivers inside the guests, so
that one is not emulating hardware for network cards, hard drives and
(soon) graphics hardware.  Most recent Linux distros will detect and
activate virtio drivers automatically when they are installed inside
KVM.

> Unfortunately it is running on a laptop and I actually have experience
> problems with fans running more than usual (although it's hard to say if
> it's Xen's fault).
> If it uses the dom0's kernel modules can't it Xen (who is aware of all
> virtual guests) make good decisions about power saving?

In practice, it doesn't work like this for Xen.  The hypervisor is
supposed to be a microkernel, so it shuns adding support for lots of
hardware, leaving that to the dom0.  But the dom0 doesn't have the
information needed to be able to make smart decisions about
powersaving (the dom0 kernel can't "see" what the other domU's are
doing).

KVM just uses the ordinary Linux kernel, so powersaving and suspend
work or don't work just the same as in ordinary Linux.  (KVM virtual
machines are treated just like ordinary Linux processes).

> Also KVM requires hardware virtualization. Isn't that slower than
> paravirtualization ?

It depends, but with EPT the hardware is basically doing exactly the
same as what Xen paravirtualization does.

Rich.

-- 
Richard Jones
Red Hat
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list