From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 2/2] virtio_net: remove send completion interrupts and avoid TX queue overrun through packet drop Date: Thu, 24 Mar 2011 10:46:49 +1030 Message-ID: <87tyetbcem.fsf@rustcorp.com.au> References: <20110318133311.GA20623@gondor.apana.org.au> <1300498915.3441.21.camel@localhost.localdomain> <1300730587.3441.24.camel@localhost.localdomain> <20110322113649.GA17071@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Herbert Xu , davem@davemloft.net, kvm@vger.kernel.org, netdev@vger.kernel.org To: "Michael S. Tsirkin" , Shirley Ma Return-path: Received: from ozlabs.org ([203.10.76.45]:32957 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933023Ab1CXAXa (ORCPT ); Wed, 23 Mar 2011 20:23:30 -0400 In-Reply-To: <20110322113649.GA17071@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 22 Mar 2011 13:36:50 +0200, "Michael S. Tsirkin" wrote: > On Mon, Mar 21, 2011 at 11:03:07AM -0700, Shirley Ma wrote: > > On Fri, 2011-03-18 at 18:41 -0700, Shirley Ma wrote: > > > > > + /* Drop packet instead of stop queue for better > > > performance > > > > */ > > > > > > > > I would like to see some justification as to why this is the right > > > > way to go and not just papering over the real problem. > > > > > > Fair. KVM guest virtio_net TX queue stop/restart is pretty expensive, > > > which involves: > > > > > > 1. Guest enable callback: one memory barrier, interrupt flag set > > > > Missed this cost: for history reason, it also involves a guest exit from > > I/O write (PCI_QUEUE_NOTIFY). > > OK, after some research, it looks like the reason was the tx timer that > qemu used to use. So the hack of avoiding the add_buf call will > avoid this kick and so break these hosts. > I guess we can add a feature bit to detect a new host > and so avoid the kick. We are running low on feature bits > unfortunately, but just fo testing, could you quantify the difference > that this makes using the following patch: Performance would suffer for those ancient qemus if we didn't do this, but it wouldn't be fatal to them. I think we should just remove it; the standard certainly doesn't mention it. Cheers, Rusty.