[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201005071253.53393.rusty@rustcorp.com.au>
Date: Fri, 7 May 2010 12:53:52 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: Avi Kivity <avi@...hat.com>
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, kvm@...r.kernel.org,
qemu-devel@...gnu.org
Subject: Re: [Qemu-devel] [PATCH RFC] virtio: put last seen used index into
ring itself
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists