All of lore.kernel.org
 help / color / mirror / Atom feed
* question on virtio
@ 2010-05-05 11:09 ` Michael S. Tsirkin
  0 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2010-05-05 11:09 UTC (permalink / raw)
  To: Rusty Russell; +Cc: virtualization, Anthony Liguori, qemu-devel, kvm

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] 15+ messages in thread

* [Qemu-devel] question on virtio
@ 2010-05-05 11:09 ` Michael S. Tsirkin
  0 siblings, 0 replies; 15+ 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] 15+ messages in thread

* question on virtio
@ 2010-05-05 11:09 Michael S. Tsirkin
  0 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2010-05-05 11:09 UTC (permalink / raw)
  To: Rusty Russell; +Cc: kvm, qemu-devel, Anthony Liguori, 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] 15+ messages in thread

* Re: question on virtio
  2010-05-05 11:09 ` [Qemu-devel] " Michael S. Tsirkin
  (?)
  (?)
@ 2010-05-05 19:40 ` Anthony Liguori
  -1 siblings, 0 replies; 15+ messages in thread
From: Anthony Liguori @ 2010-05-05 19:40 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: 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] 15+ messages in thread

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

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] 15+ messages in thread

* [Qemu-devel] Re: question on virtio
@ 2010-05-05 19:40   ` Anthony Liguori
  0 siblings, 0 replies; 15+ 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] 15+ messages in thread

* Re: question on virtio
  2010-05-05 19:40   ` [Qemu-devel] " Anthony Liguori
  (?)
  (?)
@ 2010-05-05 20:59   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 15+ messages in thread
From: Michael S. Tsirkin @ 2010-05-05 20:59 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: 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] 15+ messages in thread

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

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] 15+ messages in thread

* [Qemu-devel] Re: question on virtio
@ 2010-05-05 20:59     ` Michael S. Tsirkin
  0 siblings, 0 replies; 15+ 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] 15+ messages in thread

* Re: question on virtio
  2010-05-05 11:09 ` [Qemu-devel] " Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  (?)
@ 2010-05-06  1:32 ` Rusty Russell
  -1 siblings, 0 replies; 15+ messages in thread
From: Rusty Russell @ 2010-05-06  1:32 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: kvm, qemu-devel, Anthony Liguori, 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] 15+ messages in thread

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

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] 15+ messages in thread

* [Qemu-devel] Re: question on virtio
@ 2010-05-06  1:32   ` Rusty Russell
  0 siblings, 0 replies; 15+ 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] 15+ messages in thread

* Re: [Qemu-devel] question on virtio
  2010-05-05 11:09 ` [Qemu-devel] " Michael S. Tsirkin
                   ` (4 preceding siblings ...)
  (?)
@ 2010-05-06 16:43 ` Jamie Lokier
  -1 siblings, 0 replies; 15+ messages in thread
From: Jamie Lokier @ 2010-05-06 16:43 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: 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] 15+ messages in thread

* Re: [Qemu-devel] question on virtio
  2010-05-05 11:09 ` [Qemu-devel] " Michael S. Tsirkin
@ 2010-05-06 16:43   ` Jamie Lokier
  -1 siblings, 0 replies; 15+ messages in thread
From: Jamie Lokier @ 2010-05-06 16:43 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Rusty Russell, kvm, qemu-devel, 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] 15+ messages in thread

* Re: [Qemu-devel] question on virtio
@ 2010-05-06 16:43   ` Jamie Lokier
  0 siblings, 0 replies; 15+ 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] 15+ messages in thread

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

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.