[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring
From: |
Rusty Russell |
Subject: |
Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself |
Date: |
Wed, 19 May 2010 17:09:15 +0930 |
User-agent: |
KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.2; i686; ; ) |
On Wed, 12 May 2010 04:57:22 am Avi Kivity wrote:
> On 05/07/2010 06:23 AM, Rusty Russell wrote:
> > 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.
>
> If one peer writes the tail of the available ring, while the other reads
> last_used_idx, it's a false bounce, no?
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. I think that's
why we're debating it instead of measuring it :)
Note that this is a exclusive->shared->exclusive bounce only, too.
Cheers,
Rusty.
- [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/05
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/06
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Rusty Russell, 2010/05/06
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/11
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/11
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself,
Rusty Russell <=
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/19
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/19
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Rusty Russell, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Rusty Russell, 2010/05/20
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Avi Kivity, 2010/05/23
- Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into ring itself, Michael S. Tsirkin, 2010/05/23