On Thu, Jan 20, 2011 at 09:43:57AM -0600, Anthony Liguori wrote: > On 01/20/2011 09:35 AM, Michael S. Tsirkin wrote: > >When MSI is off, each interrupt needs to be bounced through the io > >thread when it's set/cleared, so vhost-net causes more context switches and > >higher CPU utilization than userspace virtio which handles networking in > >the same thread. > > > >We'll need to fix this by adding level irq support in kvm irqfd, > >for now disable vhost-net in these configurations. > > > >Signed-off-by: Michael S. Tsirkin<mst@xxxxxxxxxx> > > I actually think this should be a terminal error. The user asks for > vhost-net, if we cannot enable it, we should exit. > > Or we should warn the user that they should expect bad performance. > Silently doing something that the user has explicitly asked us not > to do is not a good behavior. > > Regards, > > Anthony Liguori The issue is that user has no control of the guest, and can not know whether the guest enables MSI. So what you ask for will just make some guests fail, and others fail sometimes. The user also has no way to know that version X of kvm does not expose a way to inject level interrupts with irqfd. We could have *another* flag that says "use vhost where it helps" but then I think this is what everyone wants to do, anyway, and libvirt already sets vhost=on so I prefer redefining the meaning of an existing flag. Maybe this is best handled by a documentation update? We always said: " use vhost=on to enable experimental in kernel accelerator\n" note 'enable' not 'require'. This is similar to how we specify nvectors : you can not make guest use the feature. How about this: diff --git a/qemu-options.hx b/qemu-options.hx index 898561d..3c937c1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1061,6 +1061,7 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n" " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n" " use vhost=on to enable experimental in kernel accelerator\n" + " (note: vhost=on has no effect unless guest uses MSI-X)\n" " use 'vhostfd=h' to connect to an already opened vhost net device\n" #endif "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html