lkml.org 
[lkml]   [2010]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself
Date
On Thu, 6 May 2010 07:30:00 pm Avi Kivity wrote:
> On 05/05/2010 11:58 PM, Michael S. Tsirkin wrote:
> > + /* We publish the last-seen used index at the end of the available ring.
> > + * It is at the end for backwards compatibility. */
> > + vr->last_used_idx =&(vr)->avail->ring[num];
> > + /* Verify that last used index does not spill over the used ring. */
> > + BUG_ON((void *)vr->last_used_idx +
> > + sizeof *vr->last_used_idx> (void *)vr->used);
> > }
> >
>
> Shouldn't this be on its own cache line?

It's next to the available ring; because that's where the guest publishes
its data. That whole page is guest-write, host-read.

Putting it on a cacheline by itself would be a slight pessimization; the host
cpu would have to get the last_used_idx cacheline and the avail descriptor
cacheline every time. This way, they are sometimes the same cacheline.

Hope that clarifies,
Rusty.


\
 
 \ /
  Last update: 2010-05-07 05:27    [W:0.135 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site