qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] question on virtio
@ 2010-05-05 11:09 Michael S. Tsirkin
  2010-05-05 19:40 ` [Qemu-devel] " Anthony Liguori
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-05-05 11:09 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm, qemu-devel, virtualization

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.

-- 
MST

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: question on virtio
  2010-05-05 11:09 [Qemu-devel] question on virtio Michael S. Tsirkin
@ 2010-05-05 19:40 ` Anthony Liguori
  2010-05-05 20:59   ` Michael S. Tsirkin
  2010-05-06  1:32 ` Rusty Russell
  2010-05-06 16:43 ` [Qemu-devel] " Jamie Lokier
  2 siblings, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2010-05-05 19:40 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Rusty Russell, qemu-devel, kvm, virtualization

On 05/05/2010 06:09 AM, 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.
>    

It should be okay as long as you don't update idx for partial vectors.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: question on virtio
  2010-05-05 19:40 ` [Qemu-devel] " Anthony Liguori
@ 2010-05-05 20:59   ` Michael S. Tsirkin
  0 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2010-05-05 20:59 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Rusty Russell, qemu-devel, kvm, virtualization

On Wed, May 05, 2010 at 02:40:15PM -0500, Anthony Liguori wrote:
> On 05/05/2010 06:09 AM, 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.
>>    
>
> It should be okay as long as you don't update idx for partial vectors.
>
> Regards,
>
> Anthony Liguori

Sorry, what do you mean by partial vectors here?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: question on virtio
  2010-05-05 11:09 [Qemu-devel] question on virtio Michael S. Tsirkin
  2010-05-05 19:40 ` [Qemu-devel] " Anthony Liguori
@ 2010-05-06  1:32 ` Rusty Russell
  2010-05-06 16:43 ` [Qemu-devel] " Jamie Lokier
  2 siblings, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2010-05-06  1:32 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: kvm, qemu-devel, virtualization

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] question on virtio
  2010-05-05 11:09 [Qemu-devel] question on virtio Michael S. Tsirkin
  2010-05-05 19:40 ` [Qemu-devel] " Anthony Liguori
  2010-05-06  1:32 ` Rusty Russell
@ 2010-05-06 16:43 ` Jamie Lokier
  2 siblings, 0 replies; 5+ messages in thread
From: Jamie Lokier @ 2010-05-06 16:43 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Rusty Russell, qemu-devel, kvm, virtualization

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.

Even better, if the host updates a location containing which index it
has seen recently, you can avoid the kick entirely during sustained
flows - just like your recent patch to avoid sending irqs to the
guest.

-- Jamie

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-06 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05 11:09 [Qemu-devel] question on virtio Michael S. Tsirkin
2010-05-05 19:40 ` [Qemu-devel] " Anthony Liguori
2010-05-05 20:59   ` Michael S. Tsirkin
2010-05-06  1:32 ` Rusty Russell
2010-05-06 16:43 ` [Qemu-devel] " Jamie Lokier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).