All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	kvm@vger.kernel.org, Juan Quintela <quintela@redhat.com>,
	Jes.Sorensen@redhat.com, jasowang@redhat.com,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vhost: force vhost off for non-MSI guests
Date: Fri, 21 Jan 2011 06:19:13 -0700	[thread overview]
Message-ID: <1295615953.2931.65.camel@x201> (raw)
In-Reply-To: <20110121095503.GD26070@redhat.com>

On Fri, 2011-01-21 at 11:55 +0200, Michael S. Tsirkin wrote:
> On Thu, Jan 20, 2011 at 06:35:46PM -0700, Alex Williamson wrote:
> > On Thu, 2011-01-20 at 18:23 -0600, Anthony Liguori wrote:
> > > On 01/20/2011 10:07 AM, Michael S. Tsirkin wrote:
> > > > 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@redhat.com>
> > > >>>        
> > > >> 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.
> > > >    
> > > 
> > > In the very least, there needs to be a vhost=force.
> > > 
> > > Having some sort of friendly default policy is fine but we need to 
> > > provide a mechanism for a user to have the final say.  If you want to 
> > > redefine vhost=on to really mean, use the friendly default, that's fine 
> > > by me, but only if the vhost=force option exists.
> > > 
> > > I actually would think libvirt would want to use vhost=force.  Debugging 
> > > with vhost=on is going to be a royal pain in the ass if a user reports 
> > > bad performance.  Given the libvirt XML, you can't actually tell from 
> > > the guest and the XML whether or not vhost was actually in use or not.
> > 
> > If we add a force option, let's please distinguish hotplug from VM
> > creation time.  The latter can abort.  Hotplug should print an error and
> > fail the initfn.
> 
> It can't abort at init - MSI is disabled at init, it needs to be enabled
> by the guest later. And aborting the guest in the middle of the run
> is a very bad idea.

Yeah, I was thinking about the ordering of device being added vs guest
enabling MSI this morning.  Waiting until the guest decides to try to
start using the device to NAK it with an abort is very undesirable.
What if when we have vhost=on,force, the device doesn't advertise an
INTx (PCI_INTERRUPT_PIN = 0)?

Alex


WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: kvm@vger.kernel.org, Quintela <quintela@redhat.com>,
	Jes.Sorensen@redhat.com, jasowang@redhat.com,
	qemu-devel@nongnu.org, Juan@gnu.org
Subject: Re: [Qemu-devel] [PATCH] vhost: force vhost off for non-MSI guests
Date: Fri, 21 Jan 2011 06:19:13 -0700	[thread overview]
Message-ID: <1295615953.2931.65.camel@x201> (raw)
In-Reply-To: <20110121095503.GD26070@redhat.com>

On Fri, 2011-01-21 at 11:55 +0200, Michael S. Tsirkin wrote:
> On Thu, Jan 20, 2011 at 06:35:46PM -0700, Alex Williamson wrote:
> > On Thu, 2011-01-20 at 18:23 -0600, Anthony Liguori wrote:
> > > On 01/20/2011 10:07 AM, Michael S. Tsirkin wrote:
> > > > 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@redhat.com>
> > > >>>        
> > > >> 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.
> > > >    
> > > 
> > > In the very least, there needs to be a vhost=force.
> > > 
> > > Having some sort of friendly default policy is fine but we need to 
> > > provide a mechanism for a user to have the final say.  If you want to 
> > > redefine vhost=on to really mean, use the friendly default, that's fine 
> > > by me, but only if the vhost=force option exists.
> > > 
> > > I actually would think libvirt would want to use vhost=force.  Debugging 
> > > with vhost=on is going to be a royal pain in the ass if a user reports 
> > > bad performance.  Given the libvirt XML, you can't actually tell from 
> > > the guest and the XML whether or not vhost was actually in use or not.
> > 
> > If we add a force option, let's please distinguish hotplug from VM
> > creation time.  The latter can abort.  Hotplug should print an error and
> > fail the initfn.
> 
> It can't abort at init - MSI is disabled at init, it needs to be enabled
> by the guest later. And aborting the guest in the middle of the run
> is a very bad idea.

Yeah, I was thinking about the ordering of device being added vs guest
enabling MSI this morning.  Waiting until the guest decides to try to
start using the device to NAK it with an abort is very undesirable.
What if when we have vhost=on,force, the device doesn't advertise an
INTx (PCI_INTERRUPT_PIN = 0)?

Alex

  reply	other threads:[~2011-01-21 13:19 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 15:35 [PATCH] vhost: force vhost off for non-MSI guests Michael S. Tsirkin
2011-01-20 15:35 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-20 15:43 ` Anthony Liguori
2011-01-20 15:43   ` Anthony Liguori
2011-01-20 16:07   ` Michael S. Tsirkin
2011-01-20 16:07     ` Michael S. Tsirkin
2011-01-21  0:23     ` Anthony Liguori
2011-01-21  1:35       ` Alex Williamson
2011-01-21  1:35         ` Alex Williamson
2011-01-21  9:55         ` Michael S. Tsirkin
2011-01-21  9:55           ` Michael S. Tsirkin
2011-01-21 13:19           ` Alex Williamson [this message]
2011-01-21 13:19             ` Alex Williamson
2011-01-21 13:43             ` Michael S. Tsirkin
2011-01-21 13:43               ` Michael S. Tsirkin
2011-01-21 14:40           ` Anthony Liguori
2011-01-21 14:40             ` Anthony Liguori
2011-01-21  9:48       ` Michael S. Tsirkin
2011-01-21 14:37         ` Anthony Liguori
2011-01-20 16:31 ` Sridhar Samudrala
2011-01-20 16:31   ` [Qemu-devel] " Sridhar Samudrala
2011-01-20 17:47   ` Michael S. Tsirkin
2011-01-20 17:47     ` [Qemu-devel] " Michael S. Tsirkin
2011-01-20 23:43     ` Sridhar Samudrala
2011-01-20 23:43       ` [Qemu-devel] " Sridhar Samudrala
2011-01-20 18:05 ` Alex Williamson
2011-01-20 18:05   ` [Qemu-devel] " Alex Williamson
2011-03-09 12:19 ` rukhsana ansari
2011-03-09 12:19   ` [Qemu-devel] " rukhsana ansari
2011-03-14 17:05   ` rukhsana ansari
2011-03-14 17:05     ` [Qemu-devel] " rukhsana ansari
2011-03-14 19:00     ` Michael S. Tsirkin
2011-03-14 19:00       ` Michael S. Tsirkin
2011-03-14 19:31       ` Alex Williamson
2011-03-14 19:31         ` Alex Williamson
2011-03-17 15:34         ` rukhsana ansari
2011-03-17 15:34           ` [Qemu-devel] " rukhsana ansari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295615953.2931.65.camel@x201 \
    --to=alex.williamson@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.