Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Wednesday, May 19, 2010 - 1:06 am

On 05/19/2010 10:39 AM, Rusty Russell wrote:

It's low, but why introduce an inefficiency when you can avoid doing it 
for the same effort?


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.


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.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, (Wed May 5, 1:58 pm)
Re: [PATCH RFC] virtio: put last seen used index into ring ..., Michael S. Tsirkin, (Wed May 5, 11:19 pm)
Re: [PATCH RFC] virtio: put last seen used index into ring ..., Michael S. Tsirkin, (Sun May 9, 2:06 pm)
Re: [PATCH RFC] virtio: put last seen used index into ring ..., Michael S. Tsirkin, (Tue May 11, 12:48 pm)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Tue May 11, 12:52 pm)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Avi Kivity, (Wed May 19, 1:06 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Wed May 19, 3:33 pm)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Thu May 20, 3:04 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Sun May 23, 8:31 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Sun May 23, 8:51 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Sun May 23, 8:56 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Sun May 23, 10:28 am)
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used in ..., Michael S. Tsirkin, (Mon May 24, 1:05 am)