From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: question on virtio Date: Thu, 6 May 2010 11:02:41 +0930 Message-ID: <201005061102.42306.rusty@rustcorp.com.au> References: <20100505110947.GA27872@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: virtualization@lists.linux-foundation.org, Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from ozlabs.org ([203.10.76.45]:42535 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217Ab0EFBcr (ORCPT ); Wed, 5 May 2010 21:32:47 -0400 In-Reply-To: <20100505110947.GA27872@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 5 May 2010 08:39:47 pm Michael S. Tsirkin wrote: > Hi! > I see this in virtio_ring.c: > > /* Put entry in available array (but don't update avail->idx * > until they do sync). */ > > Why is it done this way? > It seems that updating the index straight away would be simpler, while > this might allow the host to specilatively look up the buffer and handle > it, without waiting for the kick. I agree. From my TODO: what if we actually expose in ->add_buf? I don't *think* anyone adds buffers without being ready for them to be used, so changing this should be safe. Want to give it a try and report back? Thanks! Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9pxM-00023F-Ra for qemu-devel@nongnu.org; Wed, 05 May 2010 21:32:52 -0400 Received: from [140.186.70.92] (port=33408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9pxL-000222-Aa for qemu-devel@nongnu.org; Wed, 05 May 2010 21:32:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9pxJ-00017U-St for qemu-devel@nongnu.org; Wed, 05 May 2010 21:32:51 -0400 Received: from ozlabs.org ([203.10.76.45]:43097) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9pxJ-00017Q-JD for qemu-devel@nongnu.org; Wed, 05 May 2010 21:32:49 -0400 From: Rusty Russell Date: Thu, 6 May 2010 11:02:41 +0930 References: <20100505110947.GA27872@redhat.com> In-Reply-To: <20100505110947.GA27872@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005061102.42306.rusty@rustcorp.com.au> Subject: [Qemu-devel] Re: question on virtio List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org On Wed, 5 May 2010 08:39:47 pm Michael S. Tsirkin wrote: > Hi! > I see this in virtio_ring.c: > > /* Put entry in available array (but don't update avail->idx * > until they do sync). */ > > Why is it done this way? > It seems that updating the index straight away would be simpler, while > this might allow the host to specilatively look up the buffer and handle > it, without waiting for the kick. I agree. From my TODO: what if we actually expose in ->add_buf? I don't *think* anyone adds buffers without being ready for them to be used, so changing this should be safe. Want to give it a try and report back? Thanks! Rusty.