Skip to contentSkip to conversation

vhost disables kvm acceleration

DISCUSSION Asdo 1 participant 2 messages Feb 10, 2011 – Feb 11, 2011 KVM

lore
Share & tools
lore

Asdo

author
#0 lore raw

Hello
I have set up a server with kernel 2.6.37, qemu-kvm-0.13.0 compiled from source, and libvirt 0.8.3 patched so to enable use of netdev (and hence vhost).

When I modprobe vhost_net and restart a VM having virtio networking, the VM crawls at 1/100th of its normal speed.
It seems to me it's about the speed of emulation without kvm acceleration (I tried that).
If I stop the machine, remove vhost_net module, and restart the VM, it is normal speed again.

These are the invocations by libvirt:
(note that libvirt autodetects presence of vhost and uses it, the config of the VM hasn't changed ; also note that they both specify -enable-kvm ...)

without vhost_net module (=fast)

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/local/kvm/bin/qemu-system-x86_64 -S -M pc-0.13 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -name uarray_server -uuid 7db77cca-addd-4cf4-f7cd-5399d217543e -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/uarray_server.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/virtualmachines/myserver.raw,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=54,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:69:94:91:65,bus=pci.0,addr=0x3 -usb -vnc 127.0.0.1:3 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

with vhost_net module (=slow)

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/local/kvm/bin/qemu-system-x86_64 -S -M pc-0.13 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -name uarray_server -uuid 7db77cca-addd-4cf4-f7cd-5399d217543e -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/uarray_server.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/virtualmachines/myserver.raw,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=52,id=hostnet0,vhost=on,vhostfd=54 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:69:94:91:65,bus=pci.0,addr=0x3 -usb -vnc 127.0.0.1:3 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

What's the problem?

Thank you

author
#1 lore raw
Quoted 5 lines · Asdo

... qemu-kvm-0.13.0 compiled from source...

When I modprobe vhost_net and restart a VM having virtio networking, the VM crawls at 1/100th of its normal speed.
[CUT]

I just tried with the newest qemu-kvm 0.14.0-rc1, and exactly the same problem happens.

Anyone has an idea?

Thank you