From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asdo Subject: vhost disables kvm acceleration Date: Thu, 10 Feb 2011 19:49:48 +0100 Message-ID: <4D54334C.2080208@shiftmail.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit To: "'KVM-ML (kvm@vger.kernel.org)'" Return-path: Received: from mx2.isti.cnr.it ([194.119.192.4]:4360 "EHLO mx2.isti.cnr.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306Ab1BJSux (ORCPT ); Thu, 10 Feb 2011 13:50:53 -0500 Received: from SCRIPT-SPFWL-DAEMON.mx.isti.cnr.it by mx.isti.cnr.it (PMDF V6.5-x5 #31825) id <01NXO90QP04GPHR6Y4@mx.isti.cnr.it> for kvm@vger.kernel.org; Thu, 10 Feb 2011 19:49:49 +0100 (MET) Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.5-x5 #31825) id <01NXO90QBW80PHR6XO@mx.isti.cnr.it> for kvm@vger.kernel.org; Thu, 10 Feb 2011 19:49:48 +0100 (MET) Received: from [192.168.1.107] (firewall.itb.cnr.it [155.253.6.254]) by mx.isti.cnr.it (PMDF V6.5-x5 #31826) with ESMTPSA id <01NXO90P2TL2PGIP82@mx.isti.cnr.it> for kvm@vger.kernel.org; Thu, 10 Feb 2011 19:49:47 +0100 (MET) Sender: kvm-owner@vger.kernel.org List-ID: 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