[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BF39C12.7090407@redhat.com>
Date: Wed, 19 May 2010 11:06:42 +0300
From: Avi Kivity <avi@...hat.com>
To: Rusty Russell <rusty@...tcorp.com.au>
CC: "Michael S. Tsirkin" <mst@...hat.com>,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, kvm@...r.kernel.org,
qemu-devel@...gnu.org
Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into
ring itself
On 05/19/2010 10:39 AM, Rusty Russell wrote:
>
> I think we're talking about the last 2 entries of the avail ring. That means
> the worst case is 1 false bounce every time around the ring.
It's low, but why introduce an inefficiency when you can avoid doing it
for the same effort?
> I think that's
> why we're debating it instead of measuring it :)
>
Measure before optimize is good for code but not for protocols.
Protocols have to be robust against future changes. Virtio is warty
enough already, we can't keep doing local optimizations.
> Note that this is a exclusive->shared->exclusive bounce only, too.
>
A bounce is a bounce.
Virtio is already way too bouncy due to the indirection between the
avail/used rings and the descriptor pool. A device with out of order
completion (like virtio-blk) will quickly randomize the unused
descriptor indexes, so every descriptor fetch will require a bounce.
In contrast, if the rings hold the descriptors themselves instead of
pointers, we bounce (sizeof(descriptor)/cache_line_size) cache lines for
every descriptor, amortized.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists