Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753367Ab1EQCtd (ORCPT ); Mon, 16 May 2011 22:49:33 -0400 Received: from ozlabs.org ([203.10.76.45]:35228 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157Ab1EQCt0 (ORCPT ); Mon, 16 May 2011 22:49:26 -0400 From: Rusty Russell To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Carsten Otte , Christian Borntraeger , linux390@de.ibm.com, Martin Schwidefsky , Heiko Carstens , Shirley Ma , lguest@lists.ozlabs.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, Krishna Kumar , Tom Lendacky , steved@us.ibm.com, habanero@linux.vnet.ibm.com Subject: Re: [PATCH 09/18] virtio: use avail_event index In-Reply-To: <20110515135541.GF24932@redhat.com> References: <8bba6a0a8eee17e741c5155b04ff1b1c9f34bf94.1304541919.git.mst@redhat.com> <874o54h4rt.fsf@rustcorp.com.au> <20110515135541.GF24932@redhat.com> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.2.1 (i686-pc-linux-gnu) Date: Mon, 16 May 2011 16:42:21 +0930 Message-ID: <87ei3zdsq2.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2011 Lines: 60 On Sun, 15 May 2011 16:55:41 +0300, "Michael S. Tsirkin" wrote: > On Mon, May 09, 2011 at 02:03:26PM +0930, Rusty Russell wrote: > > On Wed, 4 May 2011 23:51:47 +0300, "Michael S. Tsirkin" wrote: > > > Use the new avail_event feature to reduce the number > > > of exits from the guest. > > > > Figures here would be nice :) > > You mean ASCII art in comments? I mean benchmarks of some kind. > > > > @@ -228,6 +237,12 @@ add_head: > > > * new available array entries. */ > > > virtio_wmb(); > > > vq->vring.avail->idx++; > > > + /* If the driver never bothers to kick in a very long while, > > > + * avail index might wrap around. If that happens, invalidate > > > + * kicked_avail index we stored. TODO: make sure all drivers > > > + * kick at least once in 2^16 and remove this. */ > > > + if (unlikely(vq->vring.avail->idx == vq->kicked_avail)) > > > + vq->kicked_avail_valid = true; > > > > If they don't, they're already buggy. Simply do: > > WARN_ON(vq->vring.avail->idx == vq->kicked_avail); > > Hmm, but does it say that somewhere? AFAICT it's a corollary of: 1) You have a finite ring of size <= 2^16. 2) You need to kick the other side once you've done some work. > > > @@ -482,6 +517,8 @@ void vring_transport_features(struct virtio_device *vdev) > > > break; > > > case VIRTIO_RING_F_USED_EVENT_IDX: > > > break; > > > + case VIRTIO_RING_F_AVAIL_EVENT_IDX: > > > + break; > > > default: > > > /* We don't understand this bit. */ > > > clear_bit(i, vdev->features); > > > > Does this belong in a prior patch? > > > > Thanks, > > Rusty. > > Well if we don't support the feature in the ring we should not > ack the feature, right? Ah, you're right. Thanks, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/